aggreg: Function aggreg

aggregR Documentation

Function aggreg

Description

Splits a numeric vector or matrix into subsets, computes summary statistics for each, and returns the result in a convenient form.

Usage

aggreg(x, y = NULL, fun = NULL, verbose = F, y.is.dummy = F, attr = F)

Arguments

x

Numeric vector or matrix.

y

Vector or matrix specifying the subsets to compute summary statistics for.

fun

Function specifying the summary statistic to compute. If NULL (default), mean is calculated.

verbose

Logical value specifying the verbocity of output. Defaults to F.

y.is.dummy

Logical value specifying whether y is already dummy-coded and thus does not have to be converted. Defaults to F.

attr

Logical value specifying whether subset-sizes should be added as an attribute of the returned result.

Details

Splits a numeric vector or matrix into subsets, computes summary statistics for each, and returns the result in a convenient form.

Examples

aggreg(x=1:10,y=c(rep(1,5),rep(2,5)))

AndreasFischer1985/quantqual documentation built on June 20, 2022, 4:55 p.m.