grpfun: Group Sum Mean Var

Description Usage Arguments Value Examples

View source: R/grpfn.R

Description

Calculate sum, mean, var by group with same n as original dataset Takes a variable, a group variable, function

Usage

1
grpfun(var, group, fun)

Arguments

var

variable

group

grouping var

fun

can be "var", "mean", "sum"

Value

vector

Examples

1
x <- c(1:10); grp <- c(rep(1:5, each=2));grpfun(x, grp, "mean")

soodoku/goji documentation built on Aug. 26, 2017, 8:55 a.m.