Learn R Programming

caroline (version 0.3-6)

groupBy: Group a datafame by a factor and perform aggreate functions.

Description

The R equvalent of a SQL 'group by' call .

Usage

groupBy(df, fact, cols, funcs=rep('sum',length(cols)))

Arguments

df
a data frame.
fact
the factor used to determine the grouping.
cols
the colums to include in the output.
funcs
the functions to perform on the output (default is to sum) .