Apply fun to Graph Neighborhoods

graph_stats_cell(cell_id, G, polys, fun, ...)

Arguments

cell_id

The ID of the cell to extract a local neighborhood around.

G

The graph object giving the connections between cell_ids.

polys

A spatial data.frame with a column (geometry) giving the spatial geometry of each cell.

fun

A function that can be applied to a data.frame whose rows are pixels and whose columns give features of those pixels (e.g., immune group).

...

Additional unused arguments, for consistency with other functions.

Value

result A tibble mapping the cell to statistics calculated by fun.