as.matrix,varPartResults-method | R Documentation |
Convert varPartResults to matrix
## S4 method for signature 'varPartResults'
as.matrix(x, ...)
x |
varPartResults |
... |
other arguments. |
matrix
# load library
# library(variancePartition)
# load simulated data:
# geneExpr: matrix of gene expression values
# info: information/metadata about each sample
data(varPartData)
# Specify variables to consider
# Age is continuous so we model it as a fixed effect
# Individual and Tissue are both categorical, so we model them as random effects
form <- ~ Age + (1 | Individual) + (1 | Tissue)
# Fit model
varPart <- fitExtractVarPartModel(geneExpr[1:5, ], form, info)
# convert to matrix
as.matrix(varPart)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.