read sdmx data into R dataframes
Branch: master
Clone or download
mdequeljoe Merge branch 'development'
# Conflicts:
#	DESCRIPTION
#	NEWS.md
#	src/datamessage.h
#	src/genericdata.h
Latest commit 51f4980 Feb 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R use donttest Feb 3, 2019
inst/extdata fixes #1 Feb 19, 2019
man fix invalid rd line Feb 5, 2019
src fixes #1 Feb 19, 2019
tests fixes #1 Feb 19, 2019
.Rbuildignore prepare submission Jan 9, 2019
.gitignore format file Feb 12, 2019
.travis.yml fix oldrel Jan 9, 2019
DESCRIPTION add sdmx test files Feb 5, 2019
NAMESPACE update imports Jan 8, 2019
NEWS.md re-add 0.2.3 news Feb 20, 2019
README.md update md Feb 20, 2019
cran-comments.md add resubmission Jan 21, 2019
readsdmx.Rproj read compactdata Nov 28, 2018

README.md

readsdmx

Build Status CRAN Status Github tag lifecycle

Read sdmx data into dataframes from either a local SDMX-ML file or from a SDMX web-service:

u <-
  "https://stats.oecd.org/restsdmx/sdmx.ashx/GetData/HH_DASH/..Q"
d <- readsdmx::read_sdmx(u)

The RapidXML C++ library is used to parse the data.

Install

From CRAN:

install.packages("readsdmx")

From GitHub:

devtools::install_github("mdequeljoe/readsdmx")

Data messages

The follow data message types are supported:

  • Compact (version 2.0)
  • Generic (2.0 & 2.1)
  • Structure Specific Data (2.1)
  • Utility (2.0)
  • Cross-sectional (2.0)
  • Structure Code-lists (2.0 & 2.1)

Benchmark

For the above example (locally):

download.file(u, path <- tempfile(fileext = ".xml"), quiet = TRUE)
microbenchmark::microbenchmark(
  readsdmx = readsdmx::read_sdmx(path),
  rsdmx = as.data.frame(rsdmx::readSDMX(path, FALSE)),
  times = 5L,
  unit = "s"
)

#> Unit: seconds
#>      expr    min     lq   mean median     uq    max neval
#>  readsdmx  0.152  0.153  0.159  0.161  0.165  0.165     5
#>     rsdmx 23.955 24.578 24.732 24.937 25.005 25.185     5

Related

rsdmx

pandasdmx (python)