Compute cell density from a table of cell counts and a table of tissue areas.

compute_density_from_table(counts, areas, tissue_categories, .by = "Slide ID")

Arguments

counts

A data frame with columns for .by, Tissue Category, and counts, such as the output of count_phenotypes.

areas

A data frame containing tissue areas in \(cells / micron^2\) with sample names and tissue categories matching counts.

tissue_categories

A character vector of tissue category names of interest.

.by

Column to aggregate by

Value

A data table with counts converted to density in \(cells / mm^2\).