Learn R Programming

HARplus (version 1.1.2)

create_calc_config: Create Calculation Configuration

Description

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
)

Value

A list containing:

  • column_mapping: variable mapping between datasets

  • timeline: expanded numeric sequence of simulation periods

  • exclude_self_trade: logical flag

  • exclusion_values: exclusion list by dimension

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.

Author

Pattawee Puangchit

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

See Also

create_initial_config, create_target_config, shock_calculate, shock_calculate_uniform

Examples

Run this code
# 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
)

Run the code above in your browser using DataLab