A comprehensive R package designed to preprocess, aggregate, interpolate, and expand Shared Socioeconomic Pathways (SSPs) data for seamless integration with the Global Trade Analysis Project (GTAP) framework.
The gtapssp
package simplifies the processing of SSP data by offering:
- Tools for data aggregation using regional mappings.
- Robust interpolation methods:
- Cubic Spline Interpolation for GDP and related variables.
- Beers Interpolation for population data, ideal for age-cohort structures.
- Utilities for label standardization and variable expansion.
- Support for generating outputs in
.har
format for GTAP or as.csv
.
This package is tailored for researchers and policymakers working with GTAP and SSP data, providing a streamlined workflow from raw SSP data to GTAP-compatible outputs.
To install the development version of gtapssp
from GitHub:
# Install devtools if not already installed
install.packages("devtools")
# Install gtapssp from GitHub
devtools::install_github("tsimonato/gtapssp")
Aggregate raw SSP data with regional mappings using the aggData()
function:
agg_data <- gtapssp::aggData(
iiasa_raw = gtapssp::iiasa_raw,
corresp_reg = gtapssp::corresp_reg
)
Smoothly fill gaps in GDP-related data:
spline_out <- gtapssp::interpolate_spline(
input_df = agg_data,
groups = c("model", "scenario", "reg_iso3"),
year = "year",
values = "value"
)
Interpolate population data using the Beers method:
beers_out <- gtapssp::interpolate_beers(
input_df = agg_data,
groups = c("model", "scenario", "reg_iso3"),
year = "year",
values = "value"
)
Combine interpolated datasets, expand scenarios, and prepare outputs:
final_data <- gtapssp::iiasa_gtap(outFile = "gtap_ssp.har")
This package relies on projections from the Shared Socioeconomic Pathways (SSPs) developed by IIASA. The default dataset (gtapssp::iiasa_raw
) can be updated using the updateData()
function to fetch newer versions from the IIASA SSP database.
The gtapssp::iiasa_gtap() function provides a one-liner to execute the entire SSP data processing pipeline. This includes data aggregation, interpolation, expansion, label standardization, and optional export to .har or .csv formats.
gtapssp::iiasa_gtap(outFile = "gtap_ssp.har")
We welcome contributions to enhance GTAPSSP and feel free to:
- Open an issue to report bugs or suggest features.
- Fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.