internal_aggregate: Aggregate Data Frame Columns by Group

View source: R/core_stats.R

internal_aggregateR Documentation

Aggregate Data Frame Columns by Group

Description

internal function to aggregate columns of a data frame across "ID" while considering a set of grouping columns. It retains the class and attriubtes of the input data.

Usage

internal_aggregate(data, group_cols)

Arguments

data

A data.frame containing the data to be aggregated. It should include both the grouping columns, an "ID" column, and the columns for which aggregation shall take place.

group_cols

A character vector specifying the names of the columns to group by during aggregation.

Details

internal_aggregate identifies DV columns as those not in group_cols or "ID". It then calculates the mean of these DV columns, grouped by the specified columns.

Value

A data.frame containing the aggregated data.

See Also

aggregate_stats(), calc_stats(), new_stats_dm()


dRiftDM documentation built on April 3, 2025, 7:48 p.m.