aggregate_df: Aggregates matrix or data frame

View source: R/utils.R

aggregate_dfR Documentation

Aggregates matrix or data frame

Description

Aggregates matrix or data frame

Usage

aggregate_df(df, groups, fun = mean, margin = 1, ...)

Arguments

df

A matrix or data frame

groups

A vector of groups (discrete values)

fun

A function that aggregates a vector into objects of length 1

margin

If 1, aggregates rows, if 2 aggregates columns. Defaults to 1

...

passed to fun

Value

A data.frame with aggregated rows or columns


ebecht/ebmisc documentation built on Sept. 26, 2024, 3:17 p.m.