mapCellMeta {rliger} | R Documentation |
Create new variable from categories in cellMeta
Description
Designed for fast variable creation when a new variable is going to be created from existing variable. For example, multiple samples can be mapped to the same study design condition, clusters can be mapped to cell types.
Usage
mapCellMeta(object, from, newTo = NULL, ...)
Arguments
object |
A liger object. |
from |
The name of the original variable to be mapped from. |
newTo |
The name of the new variable to store the mapped result. Default
|
... |
Mapping criteria, argument names are original existing categories
in the |
Value
When newTo = NULL
, a factor object of the new variable.
Otherwise, the input object with variable newTo
updated in
cellMeta(object)
.
Examples
pbmc <- mapCellMeta(pbmc, from = "dataset", newTo = "modal",
ctrl = "rna", stim = "rna")
[Package rliger version 2.0.1 Index]