Calculate mean values per cell group

Calculate mean values per cell group

calculate_average_by_group(x, cell_grouping)

Arguments

x

A matrix. One row for every cell; one column for every feature. The rows must be named.

cell_grouping

A data frame denoting the grouping of the cells. Format: data_frame(cell_id = character(), group_id = character()).

Examples

data(example_dataset) calculate_average_by_group( x = example_dataset$expression, cell_grouping = example_dataset$prior_information$groups_id )
#> 2 x 3 Matrix of class "dgeMatrix" #> A B C #> milestone_begin 0.07812584 4.501048 0.2619637 #> milestone_end 0.08745544 4.555942 0.7605896