aggregateBySample: Aggregates a MRexperiment object or counts matrix to by a factor.
Description
Aggregates a MRexperiment object or counts matrix to by a factor.
Usage
aggregateBySample(obj, fct, aggfun = rowMeans, out = "MRexperiment")
aggSamp(obj, fct, aggfun = rowMeans, out = "MRexperiment")
Arguments
obj
A MRexperiment object or count matrix.
fct
phenoData column name from the MRexperiment object or if count matrix object a vector of labels.
aggfun
Aggregation function.
out
Either 'MRexperiment' or 'matrix'
Value
An aggregated count matrix or MRexperiment object where the new pData is a vector of `fct` levels.
Details
Using the phenoData information in the MRexperiment, calling aggregateBySample on a
MRexperiment and a particular phenoData column (i.e. 'diet') will aggregate counts
using the aggfun function (default rowMeans). Possible aggfun alternatives
include rowMeans and rowMedians.