colmean | R Documentation |
Inspired by edgeR::sumTechReps
and base::rowsum()
, this function
takes the average of the values in each group given by the group argument
for each row of the data matrix.
colmean(x, group, na.rm = FALSE)
x |
variable (gene) by sample numeric matrix |
group |
Factor specifying the grouping level to by averaged |
na.rm |
Logical (TRUE or FALSE). Should NA (including NaN) values be discarded? |
variable x nLevels(group) matrix
# Specify the Group levels
Group <- gl(n = 2, k = 3, labels = c("DMSO", "THZ1"))
# Take the average of every gene by treatment group
by_group <- colmean(GSE161650_lc, group = Group)
by_group[1:5, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.