aggregateFrame: Compute Summary Statistics of Data Subsets

View source: R/aggregateFrame.R

aggregateFrameR Documentation

Compute Summary Statistics of Data Subsets

Description

Splits the data into subsets, computes summary statistics for each numerical variable, and returns the result in a convenient form.

Usage

aggregateFrame(data, by, compute, na.rm)

Arguments

data

A data frame

by

grouping elements,as long as the variables in the data frame data.

compute

A function to compute the summary statistics which can be applied to all numerical data subsets

na.rm

logical. Should missing values be removed

Details

For non-numerical variables, the function returns the alphabetically smallest value.

Value

An aggregated data frame.

Author(s)

T. Ruf

See Also

aggregate

Examples

data(CO2)
aggregateFrame(CO2,CO2$Type,compute="median", na.rm=T)


comb=paste(CO2$Plant, CO2$Type)
aggregateFrame(CO2,comb,compute="min", na.rm=F)


thomaspruf/fiwidat documentation built on Aug. 28, 2023, 11:12 p.m.