poolMetaData: Aggregate meta-data for cells in pools

View source: R/Microclusters.R

poolMetaDataR Documentation

Aggregate meta-data for cells in pools

Description

Used to pool a meta-data data.frame which may contain a mixture of numeric and factor variables

Usage

poolMetaData(metaData, pools)

Arguments

metaData

data.frame of meta-data for cells

pools

named list of character vector describing cell ids in each pool

Details

For numerical variables, the pooled value is just the average of the value for cells in the pool

For factors, the pooled factor value represents the majority level across cells in the pool. If there is no simple majority (e.g. no factor level > 50%), then the level '~' is substituted.

Additionally, for factor variables, a new variable of the form <Variable>_<Level> is created for each level in the factor with a value equal to the proportion of cells in the pool with that factor level.

Value

A data.frame of pooled meta-data


YosefLab/VISION documentation built on June 14, 2024, 5:27 p.m.