aggSE: aggSE

View source: R/aggregate.R

aggSER Documentation

aggSE

Description

Aggregates the rows of a 'SummarizedExperiment'.

Usage

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

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

plger/SEtools documentation built on Dec. 2, 2022, 3:58 p.m.