Package 'readsdmx'

Title: Read SDMX-XML Data
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.
Authors: Matthew de Queljoe [aut, cre], Marcin Kalicinski [ctb, cph] (Author of RapidXML library), Emmanuel Blondel [ctb, cph] (<https://orcid.org/0000-0002-5870-5762>, SDMX-ML test files), SDMX org [ctb, cph] (SDMX-ML test files)
Maintainer: Matthew de Queljoe <[email protected]>
License: GPL-3
Version: 0.3.1
Built: 2024-11-07 04:26:35 UTC
Source: https://github.com/mdequeljoe/readsdmx

Help Index


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 url) with the name where the downloaded file is saved. Tilde-expansion is performed.

quiet

If TRUE, suppress status messages (if any), and the progress bar.

method

Method to be used for downloading files. Current download methods are "internal", "wininet" (Windows only) "libcurl", "wget" and "curl", and there is a value "auto": see ‘Details’ and ‘Note’.

The method can also be set through the option "download.file.method": see options().

mode

character. The mode with which to write the file. Useful values are "w", "wb" (binary), "a" (append) and "ab". Not used for methods "wget" and "curl". See also ‘Details’, notably about using "wb" for Windows.

...

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)