Takes a named integer vector (sample names as names, integers as values) and returns a sparse 0/1 matrix where row names are sample names, column names are the unique integers, and entries indicate presence (1) or absence (0) of the integer value for each sample. This function is used in DEGAS screening.
Arguments
- x
A named integer vector. Names are treated as sample identifiers and must be unique. Values are coerced to factor levels to define columns.
- col_prefix
A single character string. If supplied, it is prepended to every column name of the returned matrix (e.g.
"V"produces"V1","V2"…). The default""keeps the original numeric levels unchanged.
Value
A sparse logical matrix of class "ngCMatrix" from the Matrix
package. Rows correspond to samples, columns to unique values, with TRUE
(1) indicating the sample carries that value.
See also
Other DEGAS:
DoDEGAS(),
LabelBinaryCells(),
LabelContinuousCells(),
LabelSurvivalCells(),
predClassBag.optimized(),
readOutputFiles.optimized(),
runCCMTL.optimized(),
runCCMTLBag.optimized(),
writeInputFiles.optimized()