View source: R/removeAllZeroVar.R
removeAllZeroVar | R Documentation |
Remove all-zero variables from design matrix and the corresponding contrast matrix
removeAllZeroVar(obj, contrasts)
## S3 method for class 'matrix'
removeAllZeroVar(obj, contrasts)
## S3 method for class 'DesignContrast'
removeAllZeroVar(obj, contrasts = NULL)
obj |
Either a design matrix, rows are samples, columns are
independent variables, and values are coefficients. Or a
|
contrasts |
Either |
Either a list of two matrices (design
and
contrasts
), or a DesignContrast
object,
depending on the input parameter type. The design matrix and contrast
matrix have an attribute each, notEstCoefs
and
notEstContrasts
, that keep track of filtered variables and contrasts.
removeAllZeroVar(matrix)
: S3 function for matrix as input
removeAllZeroVar(DesignContrast)
: S3 function for matrix as input
myTestDesign <- matrix(c(1,1,1,1, 1,1,0,0,0,0,1,1,0,0,0,0),
byrow=FALSE, nrow=4L,
dimnames=list(sprintf("S%d", 1:4), c("Baseline", "Trt1", "Trt2", "Trt3")))
myTestContrast <- matrix(c(0,1,0,0, 0,0,1,0, 0,0,0,1), nrow=4L, byrow=FALSE,
dimnames=list(colnames(myTestDesign), c("Trt1", "Trt2", "Trt3")))
removeAllZeroVar(myTestDesign, myTestContrast)
removeAllZeroVar(DesignContrast(myTestDesign, myTestContrast))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.