shift_magnitude_groups: Define Shift-Magnitude Analysis Groups

View source: R/shift-distributions.R

shift_magnitude_groupsR Documentation

Define Shift-Magnitude Analysis Groups

Description

Wrap named analysis groups so downstream shift-magnitude verbs know to run once per group rather than pooling every input into one result. Each group can be a transition table, BMM bifrost_search object, list of runs to pool, or a precomputed shift-magnitude object accepted by the downstream verb. When grouped inputs include precomputed shift_magnitude_comparison objects, compare_shift_magnitudes() requires their stored settings to match the settings requested for the grouped call.

Usage

shift_magnitude_groups(..., .list = NULL, labels = NULL)

Arguments

...

Named analysis groups. Use quoted names for labels that are not syntactic R names, such as "GIC + BIC" = runs.

.list

Optional named list of analysis groups. Use this when groups are already stored in a list.

labels

Optional replacement labels, one per analysis group. Defaults to names from the supplied groups, falling back to "Analysis 1", "Analysis 2", and so on when names are absent.

Value

A named list of class shift_magnitude_groups.

Examples

transitions <- data.frame(
  rate_change = c("increase", "increase", "decrease", "decrease"),
  rate_delta = c(2, 3, -1, -1.5)
)
groups <- shift_magnitude_groups(
  "GIC + BIC" = list(gic = transitions, bic = transitions),
  GIC = list(gic = transitions)
)
compare_shift_magnitudes(groups, ks_reps = 99)

bifrost documentation built on Nov. 5, 2026, 9:07 a.m.