# \dontshow{
if (parallel::detectCores()<=2){
options(restatapi_cores=1)
}else{
options(restatapi_cores=2)
}
# }
# \donttest{
id<-"med_rd6"
cfg<-get("cfg",envir=restatapi::.restatapi_env)
rav<-get("rav",envir=restatapi::.restatapi_env)
dsd_url <- paste0(eval(
parse(text=paste0("cfg$QUERY_BASE_URL$'",rav,"'$ESTAT$metadata$'2.1'$datastructure"))
),"/",eval(
parse(text=paste0("cfg$QUERY_PRIOR_ID$'",rav,"'$ESTAT$metadata"))
),id,"?",eval(
parse(text=paste0("cfg$QUERY_PARAMETERS$'",rav,"'$metadata[2]"))
),"=",eval(
parse(text=paste0("cfg$DATAFLOW_REFERENCES$'",rav,"'$datastructure[1]"))
)
)
if (!(grepl("amzn|-aws|-azure ",Sys.info()['release']))) options(timeout=2)
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("FREQ",dsd_xml)
options(timeout=60)
# }
Run the code above in your browser using DataLab