compute_country_shares: Compute country shares for model output by native model...

View source: R/model-downscale.R

compute_country_sharesR Documentation

Compute country shares for model output by native model region

Description

Compute country-with-model-region shares for models, downscaling proxies, nation-level socioeconomic realizations, and years. Takes in list of model data from prepare_preprocessed_data, each model's country-to-region mapping from load_country_region_mappings, and country-level downscaling proxy data from generate_ds_proxy_data. Returns a list with all combinations of model, downscaling proxy, country-level socioeconomic realization, and year.

Usage

compute_country_shares(
  model_data_list,
  country_region_map_list,
  ds_proxy_data = generate_ds_proxy_data(),
  save_output = TRUE,
  create_dir = TRUE,
  output_dir = DS_OUTPUT_DIR,
  ...
)

Arguments

model_data_list

list of model output data that has been cleaned, pre-processed, and prepared (i.e., corrected)

country_region_map_list

list of model-specific dataframes with country-to-region mapping

ds_proxy_data

list of downscaling proxy dataframes

save_output

logical indicating whether to save the output of this function

create_dir

logical indicating whether to create a new directory for the output (if one with the expected name doesn't already exist)

output_dir

directory in which to save the output

Details

Returns a list of models, each element of which is a list of downscaling proxy dataframes, each of which indicates country-within-model-region shares, to be used by downscale_flow_variables in order to downscale region-level model output to the country level. Returned data are filtered to the years reported by each model, and include all possible nation-level socioeconomic realizations.


transportenergy/item_mip_data_processing documentation built on July 6, 2023, 7:51 p.m.