aggSE: aggSE

Description Usage Arguments Value Examples

View source: R/aggregate.R

Description

Aggregates the rows of a 'SummarizedExperiment'.

Usage

1
aggSE(x, by, assayFun = NULL, rowDatFuns = list())

Arguments

x

An object of class 'SummarizedExperiment'

by

Vector by which to aggregate, or column of 'rowData(x)'

assayFun

Function by which to aggregate, or a list of such functions (or vector of function names) of the same length as there are assays. If NULL will attempt to use an appropriate function (and notify the functions used), typically the mean.

rowDatFuns

A named list providing functions by which to aggregate each rowData columns. If a given column has no specified function, the default will be used, i.e. logical are transformed into a proportion, numerics are aggregated by median, and unique factors/characters are pasted together. Use 'rowDataFuns=NULL' to discard rowData.

Value

An object of class 'SummarizedExperiment'

Examples

1
2
3
4
5
library(SummarizedExperiment)
data("SE", package="SEtools")
# arbitrary IDs for example aggregation:
rowData(SE)$otherID <- rep(LETTERS[1:10],each=10)
SE <- aggSE(SE, "otherID")

SEtools documentation built on Nov. 8, 2020, 8:21 p.m.