Skip to content

Instantly share code, notes, and snippets.

@NTerpo
Created March 10, 2016 16:11
Show Gist options
  • Save NTerpo/8d81bb33e5a062253400 to your computer and use it in GitHub Desktop.
Save NTerpo/8d81bb33e5a062253400 to your computer and use it in GitHub Desktop.
$ git clone https://github.com/opensdmx/rsdmx.git
$ R
> install.packages("path/to/rsdmx", repos=NULL, type="source")
> packageVersion("rsdmx")
[1] ‘0.5.2’
> library(rsdmx)
> ulc.data <- readSDMX(file = "http://stats.oecd.org/restsdmx/sdmx.ashx/GetData/PDBI_I4/AUS+AUT+BEL+CAN+CHL+CZE+DNK+EST+FIN+FRA+DEU+GRC+HUN+IRL+ISR+ITA+JPN+KOR+LUX+MEX+NLD+NZL+NOR+POL+PRT+SVK+SVN+ESP+SWE+CHE+GBR+USA+EA19+EU28+NMEC+LVA+LTU+ZAF.I4_ANA_GVAHRS+I4_ANA_ULCH+I4_ANA_LCHRS.GRW+AVGRW.A_U+BNEXCL+B_E+BDE+C+F+GNEXCL+G_I+J+K+MN/all?startTime=2001&endTime=2015")
> ulc.dsd <- readSDMX(file = "http://stats.oecd.org/restsdmx/sdmx.ashx/GetDataStructure/PDBI_I4")
> ulc.data <- setDSD(ulc.data, ulc.dsd)
> ulc <- as.data.frame(ulc.data, labels=TRUE)
> write.csv(ulc, file="ulc.csv")
@fpassaniti
Copy link

Too easy to be honest

NoPainNoGain #SDMXforNewbees

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment