Description Usage Arguments Value
Apply fun to Local Neighborhoods
1 2 3 4 5 6 7 8 | raster_stats_cell(
cell_id,
im,
polys,
fun,
buffer_radius = 90,
plot_masks = TRUE
)
|
cell_id |
The ID of the cell to extract a local neighborhood around. |
im |
The raster object giving the pixel-level information about the sample. |
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). |
buffer_radius |
The size of the window around cell_id, to use to subset the raster on which to apply fun. |
plot_masks |
If you want to see what the subsets of cells looks like, you can use this. |
result A tibble mapping the cell to statistics calculated by fun.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.