Type: | Package |
Title: | Read SDMX-XML Data |
Version: | 0.3.1 |
Maintainer: | Matthew de Queljoe <matthew.dequeljoe@gmail.com> |
Description: | 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 https://rapidxml.sourceforge.net/ is used to parse the XML data. |
URL: | https://github.com/mdequeljoe/readsdmx |
BugReports: | https://github.com/mdequeljoe/readsdmx/issues |
License: | GPL-3 |
Encoding: | UTF-8 |
Imports: | Rcpp (≥ 0.12.18), utils |
LinkingTo: | Rcpp |
RoxygenNote: | 6.1.1 |
Suggests: | testthat |
NeedsCompilation: | yes |
Packaged: | 2023-09-01 16:09:11 UTC; Dequeljoe_M |
Author: | Matthew de Queljoe [aut, cre],
Marcin Kalicinski [ctb, cph] (Author of RapidXML library),
Emmanuel Blondel |
Repository: | CRAN |
Date/Publication: | 2023-09-02 05:10:23 UTC |
Read SDMX data
Description
read SDMX data into R as dataframes
Usage
read_sdmx(path, destfile = tempfile(fileext = ".xml"), quiet = TRUE,
method = "libcurl", mode = "w", ...)
Arguments
path |
Character; the path to an SDMX-ML xml file |
destfile |
a character string (or vector, see |
quiet |
If |
method |
Method to be used for downloading files. Current
download methods are The method can also be set through the option
|
mode |
character. The mode with which to write the file. Useful
values are |
... |
allow additional arguments to be passed, unused. |
Details
read_sdmx returns a dataframe with the SDMX data 'as-is' which means that all columns will be character vectors. The base R function 'download.file' is used when a url is provided to read_sdmx.
Value
data.frame object
Examples
f <- system.file("extdata/compact_2.0.xml", package = "readsdmx")
d <- readsdmx::read_sdmx(f)
u <-
"https://stats.oecd.org/restsdmx/sdmx.ashx/GetData/HH_DASH/..Q/all?format=compact_v2"
d <- readsdmx::read_sdmx(u)