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.
internal_aggregate(data, group_cols)A data.frame containing the aggregated 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.
A character vector specifying the names of the columns to group by during aggregation.
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. Columns specified in group_cols that are not part of
data are ignored silently.
aggregate_stats(), calc_stats(),
new_stats_dm()