extract_dsd: Extract values from XML

Description Usage Arguments Details Value Examples

View source: R/extract_dsd.R

Description

Extracts the values from the XML Data Structure Definition (DSD) file

Usage

1
extract_dsd(concept = NULL, dsd_xml = NULL)

Arguments

concept

a character vector with concept ids

dsd_xml

an XML file with DSD content

Details

It is a subfunction to use in the get_eurostat_dsd function.

Value

a matrix with 3 columns if the concepts has code list in the DSD file

Examples

1
2
3
4
5
6
7
8
dsd_url<-"http://ec.europa.eu/eurostat/SDMX/diss-web/rest/datastructure/ESTAT/DSD_nama_10_a10_e"
tryCatch({
  dsd_xml<-xml2::read_xml(dsd_url)}, 
  error=function(e){
  message("Unable to download the xml file.\n",e)}, 
  warning=function(w){
  message("Unable to download the xml file.\n",w)}) 
if (exists("dsd_xml")) {extract_dsd("GEO",dsd_xml)} 

restatapi documentation built on July 24, 2019, 1:05 a.m.