1 Usage

For both R Scripts, simply open the files with RStudio and run the functions inside in the order below.

R Scripts

  1. gdp_etl_pipeline.R Contains one function which runs the entire ETL pipeline.
  2. gdp_etl_plots.R Contains one function which generates comparison plots for all individual economies and groups of economies. The plots are exported to a pdf file.

Working Directory

The scripts automatically set the working directory to the location of the active R script file in RStudio.

Directories

Defines paths for:

  • datadir: Data input
  • outputdir: Output files

Economy Metadata

Files found in datadir:

  • Dim_countries.csv: Contains economy codes and valid year ranges.
  • Dim_Countries_Hierarchy_All.csv: Contains hierarchical grouping for aggregations.
  • lab_all.csv: Contains economy codes and labels.
  • GDP growth rates.xlsx: Contains growth rates for all economies.
  • US.GDPTotal_20250718_104458.csv Last release of GDP dataset at UNCTADstat

Output Files

Files found in outputdir:

  • gdp_comparison.csv: A dataset containing old and new GDP values.
  • GDP_comparison_groups.pdf: Comparison plots of all individual economies and groups of economies.
  • gdp_update.csv: An updated dataset in a generic format.
  • gdp_update_usis.csv: An updated dataset in a specific format to be used by USIS for uploading to UNCTADstat.