sumGroups: sumGroups

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Utility function to sum over group labels

Usage

1
2
3
4
5
6
7
sumGroups(X, y, MARGIN = 2)

## S3 method for class 'dgCMatrix'
sumGroups(X, y, MARGIN = 2)

## S3 method for class 'matrix'
sumGroups(X, y, MARGIN = 2)

Arguments

X

matrix

y

group labels

MARGIN

whether observations are rows (=2) or columns (=1)

Value

Matrix of groups by features

Examples

1
2
3
4
data(exprs)
data(y)
sumGroups_res <- sumGroups(exprs, y, 1)
sumGroups_res <- sumGroups(t(exprs), y, 2)

immunogenomics/presto documentation built on July 24, 2020, 11:47 p.m.