Defines calculation settings for generating shock values, including variable mapping,
timeline sequence, and exclusion criteria. Used as input for both
shock_calculate and shock_calculate_uniform.
Usage
create_calc_config(
column_mapping = NULL,
timeline = 1,
exclude_self_trade = FALSE,
exclusion_values = NULL
)Arguments
- column_mapping
Optional named vector mapping initial and target columns (e.g.,
c(COMM = "COMM", REG = "REG", REG.1 = "REG.1")).- timeline
Numeric or character range defining simulation periods.
Example: "1-5" expands to 1:5.
- exclude_self_trade
Logical; if TRUE, removes intra-region records. Default is FALSE.
- exclusion_values
Optional named list of elements to exclude from calculation.
Value
A list containing:
column_mapping: variable mapping between datasetstimeline: expanded numeric sequence of simulation periodsexclude_self_trade: logical flagexclusion_values: exclusion list by dimension
Details
Controls column alignment between initial and target datasets
Supports numeric or range-based timeline definitions (e.g., "1-10")
Excludes self-trade or specified region/sector pairs if configured
Provides core metadata for shock calculation functions
Examples
# Example: Define Calculation Configuration
calc <- create_calc_config(
column_mapping = c(COMM = "COMM", REG = "REG", REG.1 = "REG.1"),
timeline = "1-5",
exclude_self_trade = TRUE
)