aggregate2: Aggregate, an Alternative formula-Interface

View source: R/aggregate2.R

aggregate2R Documentation

Aggregate, an Alternative formula-Interface

Description

An alternative aggregation function with a formula-interface, to avoid the cbind-operation in the function aggregate.formula.

Usage

aggregate2(data, by, ...)

Arguments

data

a data.frame

by

a two-sided formula

...

additional parameters of the function aggregate.data.frame, except for simplify

Details

The cbind-operation in the function aggregate.formula messes up with column(s) that are

factor

and treat them as integer

Surv

and treat them as matrix

The function aggregate.data.frame only accepts a list of factors for the parameter by.

Therefore, the function aggregate2() is created to take care of the factor and Surv columns of the input, with a formula-interface.

Value

The function aggregate2() returns a data.frame.

Note

The function aggregate.data.frame is the workhorse of the function aggregate.formula.

The function as.hyperframe.data.frame is designed to handle the list-columns returned by the function aggregate.


groupedHyperframe documentation built on June 21, 2026, 5:11 p.m.