aggregate | R Documentation |
Aggregate
aggregate(x, ...)
## S4 method for signature 'SingleCellExperiment'
aggregate(x, col = "aggregate", fun = "sum", MARGIN = 1L)
x |
Object. |
col |
|
fun |
|
MARGIN |
|
... |
Additional arguments. |
SingleCellExperiment
.
aggregate(SummarizedExperiment)
: Arguments pass through to matrix
or Matrix
method, depending on the class
of matrix defined in requested assay
.
matrix
, Matrix
:
Aggregate using a grouping factor
.
SummarizedExperiment
:
Aggregate data slotted in assays()
using an automatically generated
grouping factor
, which is obtained from a user-defined column
(col
argument) in either the rowData()
or colData()
of the object.
Slot an aggregate
column into rowData()
for aggregateRows()
, or into
colData()
for aggregateCols()
. This method will define the groupings
automatically, and perform the aggregation.
Updated 2022-05-24.
Michael Steinbaugh, Rory Kirchner
stats::aggregate()
.
S4Vectors::aggregate()
.
Matrix.utils::aggregate.Matrix()
.
muscat::aggregateData()
.
data(SingleCellExperiment_lanesplit, package = "AcidTest")
## SingleCellExperiment ====
x <- SingleCellExperiment_lanesplit
levels(SummarizedExperiment::colData(x)[["aggregate"]])
x <- aggregate(
x = x,
col = "aggregate",
fun = "sum",
MARGIN = 2L
)
print(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.