opensdmx/rsdmx

R 4.3.0 -> Calling && or || -> sugnificant change

Closed this issue · 3 comments

Dear maintainer,

the significant user-visible change in R 4.3.0 has an impact on the as.data.frame-method for SDMX class. That is, SDMX objects cannot any longer be coerced to data.frame, but an error message is returned.

Would you be so kind and fix this issue?
Many thanks,
Bernhard

@bpfaff can you please share an example of code you try to run and that fails with R 4.3.0 ? thanks

Sure, please have a look at the code snippet below. In earlier R versions (< 4.3.0) the coercion to data.frame passed flawlessly.

url <- paste0("https://api.statistiken.bundesbank.de/rest/data/",

  •           "BBK01/SU0200",
    
  •           "?startPeriod=1999-01")
    

ans.rest <- readSDMX(url)
str(ans.rest)
Formal class 'SDMXGenericData' [package "rsdmx"] with 6 slots
..@ dsdRef: chr "BBK01"
..@ dsd : NULL
..@ xmlObj:Classes 'XMLInternalDocument', 'XMLAbstractDocument'
..@ schema:Formal class 'SDMXSchema' [package "rsdmx"] with 1 slot
.. .. ..@ version: chr "2.1"
..@ header:Formal class 'SDMXHeader' [package "rsdmx"] with 11 slots
.. .. ..@ ID : chr "BBK01_SU0200"
.. .. ..@ Test : logi FALSE
.. .. ..@ Truncated : logi FALSE
.. .. ..@ Name : chr NA
.. .. ..@ Sender :List of 3
.. .. .. ..$ id : chr "BBK"
.. .. .. ..$ name :List of 1
.. .. .. .. ..$ de: chr "Deutsche Bundesbank"
.. .. .. ..$ timezone: chr NA
.. .. ..@ Receiver :List of 3
.. .. .. ..$ id : logi NA
.. .. .. ..$ name : logi NA
.. .. .. ..$ contact: NULL
.. .. ..@ Prepared : POSIXlt[1:1], format: "2023-03-31 14:32:21"
.. .. ..@ Extracted : POSIXlt[1:1], format: NA
.. .. ..@ ReportingBegin: POSIXlt[1:1], format: NA
.. .. ..@ ReportingEnd : POSIXlt[1:1], format: NA
.. .. ..@ Source : chr NA
..@ footer:Formal class 'SDMXFooter' [package "rsdmx"] with 1 slot
.. .. ..@ messages: list()
ans.df <- as.data.frame(ans.rest)
Fehler in !is.na(obsAttrs.df) && ifelse(is.na(any(obsAttrs.df == "NULL")), :
'length = 2' in coercion to 'logical(1)'
sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8
[3] LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C
[5] LC_TIME=German_Germany.utf8

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rsdmx_0.6-2 zoo_1.8-12

loaded via a namespace (and not attached):
[1] httr_1.4.5 compiler_4.3.0 plyr_1.8.8 R6_2.5.1 tools_4.3.0
[6] curl_5.0.0 Rcpp_1.0.10 grid_4.3.0 XML_3.99-0.14 lattice_0.21-8
[11] fortunes_1.5-4

should be fixed