Read SDMX-XML Data

Read Statistical Data and Metadata Exchange (SDMX) XML data. This the main transmission format used in official statistics. Data can be imported from local SDMX-ML files or a SDMX web-service and will be read in 'as is' into a dataframe object. The 'RapidXML' C++ library < http://rapidxml.sourceforge.net> is used to parse the XML data.


Build Status CRAN Status

Read sdmx data into R 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

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)
  • 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.158  0.164  0.176  0.166  0.176  0.217     5
#>     rsdmx 26.321 26.992 30.762 30.757 34.341 35.397     5

Related

rsdmx

News

0.2.0

  • The follow data message types are supported:
    • Compact (version 2.0)
    • Generic (2.0 & 2.1)
    • Structure Specific Data (2.1)
    • Structure Code-lists (2.0 & 2.1)
  • Data from web-services obtained via 'download.file'

0.2.1

  • Performance improvements to reading compact and generic data
  • Minor fixes for CRAN policies for first submission

0.2.2

  • Add more checks for invalid SDMX-ML files and unsupported messages:
    • Checks that a 'structures' node exists for Code-lists messages
    • Checks that a 'DataSet' node exists for compact and generic data
  • CRAN fix to include a runnable R example

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("readsdmx")

0.2.2 by Matthew de Queljoe, 5 months ago


https://github.com/mdequeljoe/readsdmx


Report a bug at https://github.com/mdequeljoe/readsdmx/issues


Browse source code at https://github.com/cran/readsdmx


Authors: Matthew de Queljoe [aut, cre] , Marcin Kalicinski [ctb, cph] (Author of RapidXML library) , Emmanuel Blondel [ctb, cph] , SDMX-ML test files)


Documentation:   PDF Manual  


GPL-3 license


Imports Rcpp, utils

Suggests testthat

Linking to Rcpp


See at CRAN