covariates<-,Classifier-method {Allspice} | R Documentation |
Sample covariate data
Description
Add covariate data into the classifier.
Usage
covariates(obj) <- value
Arguments
obj |
An object of the class Classifier. |
value |
A numeric vector or a matrix. |
Details
If the input is a vector, the elements must be named and these names will be used to identify variables.
If the input is a matrix, it must have named rows and named columns that
will be matched with sample identities in profiles()
.
Value
Updates the Classifier object. Any previous data are discarded.
Examples
# Simulated data.
simu <- bcellALL(5)
# Predict subtypes without covariates.
cls <- classifier(verbose = FALSE)
profiles(cls) <- simu$counts
primary <- predictions(cls)[[1]]
print(primary[,c("LABEL","PROX","EXCL")])
# Predict subtypes with covariates.
cls <- classifier(verbose = FALSE)
covariates(cls) <- simu$metadata
profiles(cls) <- simu$counts
primary <- predictions(cls)[[1]]
print(primary[,c("LABEL","PROX","EXCL")])
[Package Allspice version 1.0.7 Index]