aggregate.m: Aggregate from multiple columns.

Description Usage Arguments Value Author(s) Examples

View source: R/aggregate.m.R

Description

Augments the aggregate function with the ability to handle functions that require mulitple arguments. Each column specified in the response is a different argument for FUN.

Usage

1
2
3

Arguments

formula

The formula overwhich to aggregate. The response variable is given multiple columns by using cbind. e.g. cbind(x,y) ~ group

data

The data to aggregate over.

args

The columns which are to be the input arguments to the aggregating funciton, in order.

by

The actual columns which data will be aggregated by, as per aggregate.

FUN

The function by which to aggregate. There should be the same number of arguments to this function as there are columns in the dependent variable of the formula or the column names in 'args'.

Value

An aggregate data frame, for each unique set of 'by' columns (or the dependent variables of the fromula version is used) the result of apply the function to all rows with those column values is given.

Author(s)

David Little

Examples

1
2
3
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

haberdashPI/wright.lab.util documentation built on Nov. 4, 2019, 1:25 p.m.