# Example 1: Uniform Shock (50% Reduction)
har_path <- system.file("extdata", "baserate.har", package = "HARplus")
# Sorting Column
mapping <- list(
REG = c("USA", "EU", "ROW")
)
# Initial File
initial <- create_initial_config(
path = har_path,
format = "har",
header = "rTMS"
)
# Calculation Setup
calc <- create_calc_config(
timeline = "1-10",
exclude_self_trade = TRUE
)
# Compute Uniform 50% Reduction (Value_tar = Value_ini * 0.5)
shock_calculate_uniform(
initial_config = initial,
adjustment_value = 0.5,
calculation_method = "*",
calc_config = calc,
output_path = file.path(tempdir(), "output_uniform.har"),
dim_order = mapping
)
Run the code above in your browser using DataLab