Skip to content

Tools for preprocessing Shared Socioeconomic Pathways (SSPs) data for integration with the Global Trade Analysis Project (GTAP) framework.

License

Notifications You must be signed in to change notification settings

tsimonato/gtapssp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTAPSSP: SSPs for GTAP Framework ☕

R-CMD-check License: MIT Website

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.

📖 Overview

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.

🚀 Installation

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")

🛠️ Key Features

1. Data Aggregation

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
)

2. Interpolation

Spline Interpolation

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"
)

Beers Interpolation

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"
)

3. Output Preparation

Combine interpolated datasets, expand scenarios, and prepare outputs:

final_data <- gtapssp::iiasa_gtap(outFile = "gtap_ssp.har")

🌐 Data Source

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.

📦 One-Line Workflow

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")

📚 Documentation

🤝 Contributions

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.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Tools for preprocessing Shared Socioeconomic Pathways (SSPs) data for integration with the Global Trade Analysis Project (GTAP) framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages