Open oliverbott opened 9 years ago
Hello everyone, if you want to use OECD data for your project, I recommend getting the "rsdmx" package for R. This link is very helpful: https://github.com/opensdmx/rsdmx/wiki#package_status
These are the codes I used to get the rsdmx package running in R.
install.packages("devtools") require("devtools") install_github("rsdmx", "opensdmx") library("rsdmx")
Once you opened the OECD statistics you are interested in, you click on EXPORT and choose SDMX. Copy the SDMX DATA URL. It will look something like this:
http://stats.oecd.org/restsdmx/sdmx.ashx/GetData/CITIES/DEU+DE001+DE002+DE003+DE004+DE005+DE006+DE007+DE008+DE009+DE010+DE011+DE012+DE013+DE014+DE015+DE027+DE033+DE034+DE035+DE040+DE501+DE502+DE504+DE507.PCT_INTENSITY?startTime=2000&endTime=2012
With these codes you turn the SDMX data into a nice data frame ready for tidying up.
dataURL <- "http://stats.oecd.org/restsdmx/sdmx.ashx/GetData/CITIES/DEU+DE001+DE002+DE003+DE004+DE005+DE006+DE007+DE008+DE009+DE010+DE011+DE012+DE013+DE014+DE015+DE027+DE033+DE034+DE035+DE040+DE501+DE502+DE504+DE507.PCT_INTENSITY?startTime=2000&endTime=2012" sdmx <- readSDMX(dataURL) stats <- as.data.frame(sdmx)
I hope this helps.
That's great. Thanks for sharing. (I just made some minor formatting edits).
Hello everyone, if you want to use OECD data for your project, I recommend getting the "rsdmx" package for R. This link is very helpful: https://github.com/opensdmx/rsdmx/wiki#package_status
Installing the package
These are the codes I used to get the rsdmx package running in R.
Getting the SMDX link
Once you opened the OECD statistics you are interested in, you click on EXPORT and choose SDMX. Copy the SDMX DATA URL. It will look something like this:
http://stats.oecd.org/restsdmx/sdmx.ashx/GetData/CITIES/DEU+DE001+DE002+DE003+DE004+DE005+DE006+DE007+DE008+DE009+DE010+DE011+DE012+DE013+DE014+DE015+DE027+DE033+DE034+DE035+DE040+DE501+DE502+DE504+DE507.PCT_INTENSITY?startTime=2000&endTime=2012
Turning SDMX file into a table
With these codes you turn the SDMX data into a nice data frame ready for tidying up.
I hope this helps.