byMean: Fast conditional mean

Description Usage Arguments Value

View source: R/byMean.R

Description

byMean works like a very fast version of tapply with (weighted) FUN=mean or FUN=weighted.mean.

Usage

1
byMean(x, by, na.rm = FALSE, weight = NULL, ...)

Arguments

x

numeric vector to be averaged

by

(list of) factor(s) for which the mean will be calculated

na.rm

logical If TRUE NA values will be removed

weight

numeric with of same length as x

...

not used

Value

array with dimensions of by


ffbase documentation built on Feb. 27, 2021, 5:06 p.m.