From 13cd12f4064a6a079865b2de109ceea04b4a1183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20M=C3=A1ty=C3=A1s=20Tam=C3=A1s?= Date: Wed, 26 Jan 2022 12:47:13 +0000 Subject: [PATCH] correcting example for CRAN release --- DESCRIPTION | 4 ++-- NEWS.md | 6 ++++++ R/extract_toc.R | 14 +++++++------- man/extract_toc.Rd | 13 ++++++------- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ee559f9..f925063 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: restatapi Type: Package Title: Search and Retrieve Data from Eurostat Database -Date: 2021-11-22 -Version: 0.12.7 +Date: 2022-01-26 +Version: 0.12.8 Encoding: UTF-8 Authors@R: person("Mátyás", "Mészáros", email = "matyas.meszaros@ec.europa.eu", role = c("aut", "cre")) Description: Eurostat is the statistical office of the European Union and provides high quality statistics for Europe. diff --git a/NEWS.md b/NEWS.md index 19cb933..875a17c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# restatapi 0.12.8 + +- correction of example in `extract_toc()` function +- CRAN release + # restatapi 0.12.7 - correction of parallel processing under Windows in the `get_eurostat_dsd()`, `get_eurostat_raw()` and `get_eurostat_data()` functions @@ -20,6 +25,7 @@ - adding timeout to examples - not testing example for the `search_eurostat_dsd()` and `create_filter_table()` function +- CRAN release # restatapi 0.12.2 diff --git a/R/extract_toc.R b/R/extract_toc.R index 8dbbda8..e3cb807 100644 --- a/R/extract_toc.R +++ b/R/extract_toc.R @@ -21,16 +21,16 @@ #' error = function(e) {xml_leafs<-""}, #' warning = function(w) {xml_leafs<-""}) #' if (exists("xml_leafs")){ -#' if (Sys.info()[['sysname']]=='Windows') { -#' xml_node<-as.character(xml_leafs[1]) -#' } else { -#' xml_node<-xml_leafs[1] -#' } -#' restatapi::extract_toc(xml_node) +#' if (Sys.info()[['sysname']]=='Windows'){ +#' xml_node<-as.character(xml_leafs[1]) +#' }else{ +#' xml_node<-xml_leafs[1] +#' } +#' restatapi::extract_toc(xml_node) #' } #' options(timeout=60) #' } -#' + extract_toc<-function(ns){ if (Sys.info()[['sysname']]=='Windows'){ns<-xml2::as_xml_document(ns)} diff --git a/man/extract_toc.Rd b/man/extract_toc.Rd index 763c198..25c61df 100644 --- a/man/extract_toc.Rd +++ b/man/extract_toc.Rd @@ -35,14 +35,13 @@ tryCatch(xml_leafs<-xml2::xml_find_all(xml2::read_xml(toc_endpoint),".//nt:leaf" error = function(e) {xml_leafs<-""}, warning = function(w) {xml_leafs<-""}) if (exists("xml_leafs")){ - if (Sys.info()[['sysname']]=='Windows') { - xml_node<-as.character(xml_leafs[1]) - } else { - xml_node<-xml_leafs[1] - } - restatapi::extract_toc(xml_node) + if (Sys.info()[['sysname']]=='Windows'){ + xml_node<-as.character(xml_leafs[1]) + }else{ + xml_node<-xml_leafs[1] + } + restatapi::extract_toc(xml_node) } options(timeout=60) } - }