agg: Data aggregation

Description Usage Arguments Details Value Examples

View source: R/agg.r

Description

Data aggregation

Usage

1
agg(x, cols, by, FUN = sum, ...)

Arguments

x

a data frame

cols

the columns to aggregate

by

grouping elements

FUN

function used to aggregate the data

...

further parameters passed to 'aggregate' or to 'FUN'

Details

This function is a convenient wrapper for aggregate. It is implemented as 'aggregate( x[,cols], x[, by], FUN, ...)'.

Value

a data frame, with the data in 'x[,cols]\' aggregated according to the levels of the factors in 'x[,by]'.

Examples

1
agg(departements, cols = c("superficie", "population"), by = "région")

HervePerdry/covid19.SPF documentation built on Jan. 30, 2022, 7:22 p.m.