aggregate: Aggregate a table by specified keys

Description Usage Arguments Details

Description

Aggregate the input table using the specified aggregation function, using the specified columns as keys.

Usage

1
aggregate(tbl, aggfn, aggkeys, multiple = FALSE)

Arguments

tbl

Table to aggregate

aggfn

String giving the aggregation function. If missing, use sum.

aggkeys

String giving a list of aggregation keys. If missing, return the table unmodified.

multiple

If TRUE, aggregate multiple columns. For now, all of these columns must match the regex 'value' (e.g., 'value.x' and 'value.y')

Details

The multiple argument is used for cases where we need to perform the same aggregation on multiple values. Usually this occurs when we have joined two tables, so for now the aggregation operates only on columns matching the regular expression 'value', which would catch the 'value.x' and 'value.y' created by a join. In future versions we may allow specifying arbitrary columns, but until we are fully upgraded to dplyr 0.7 that is too much of a hassle.


JGCRI/iamrpt documentation built on June 30, 2019, 3:19 a.m.