Convert discrete annotations to dummy variable matrices.
codeY_vec(vec, rowNames = NULL, method = c("-1,1", "0,1"))
Arguments
- vec
Factor contanining class labels.
- rowNames
Optional. Row names for output dummy matrix (eg cell barcode).
- method
Which coding to use, either (-1,1) or (0,1).
Value
- YY
A dummy variable matrix encoding discrete annotation
Examples
codeY_vec(c("B", "T", "T", "NK"), rowNames = paste0("cell", 1:4))
codeY_vec(c("B", "T", "T", "NK"), method = "0,1")