Skip to contents

[Deprecated]

agg_totals() was renamed to agg_variates() because the new name better describes that the function aggregates mcnode variates across grouping variables.

Usage

agg_totals(
  mcmodule,
  mc_name,
  agg_keys = NULL,
  agg_suffix = NULL,
  prefix = NULL,
  name = NULL,
  summary = TRUE,
  keep_variates = FALSE,
  agg_func = NULL
)

Arguments

mcmodule

An mcmodule object. Module containing node list and data.

mc_name

Character. Name of node to aggregate.

agg_keys

Character vector, optional. Column names for grouping. If NULL, defaults to "scenario_id". Default: NULL.

agg_suffix

Character, optional. Suffix for aggregated node name. Default: NULL.

prefix

Character, optional. Prefix for output node name. Default: NULL.

name

Character, optional. Custom name for output node. Default: NULL.

summary

Logical. If TRUE, include summary statistics. Default: TRUE.

keep_variates

Logical. If TRUE, preserve individual variate values. Default: FALSE.

agg_func

Character, optional. Aggregation method: "prob" for combined probability, "sum", "avg", or NULL for automatic selection. Default: NULL.

Value

An mcmodule object with a new aggregated node added.

See also