rowsum | R Documentation |
Condense the rows of a DGEList object so that counts are summed over specified groups of genes.
## S3 method for class 'DGEList' rowsum(x, group, reorder=FALSE, na.rm=FALSE, ...) ## S3 method for class 'SummarizedExperiment' rowsum(x, group, reorder=FALSE, na.rm=FALSE, ...)
x |
a |
group |
a vector or factor giving the grouping, with one element per row of |
reorder |
if |
na.rm |
logical ( |
... |
other arguments are not currently used |
If x
is a SummarizedExperiment
object, it is first converted into a DGEList
object.
A new DGEList
object is computed, with the same columns as x
, but for which the rows correspond to the unique values of group
.
The counts for rows with the same group
value are summed.
Columns of x$genes
will be retained in the output if they contain group-level annotation.
Columns that vary within groups will be dropped.
DGEList
object with the same number of columns as x
and rows corresponding to the unique values of group
.
Gordon Smyth
rowsum
in the base package.
x <- DGEList(counts=matrix(1:8,4,2)) rowsum(x, group=c("A","A","B","B"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.