raster_stats_cell: Apply fun to Local Neighborhoods

Description Usage Arguments Value

View source: R/processing.R

Description

Apply fun to Local Neighborhoods

Usage

1
2
3
4
5
6
7
8
raster_stats_cell(
  cell_id,
  im,
  polys,
  fun,
  buffer_radius = 90,
  plot_masks = TRUE
)

Arguments

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.

Value

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


krisrs1128/BIRSBIO2020.scProteomics.embeddings documentation built on July 29, 2020, 7:36 a.m.