opensdmx/rsdmx

as.data.frame or as_tibble broken with R 4.3.x, using && with expression of length greater than 1

ellisp opened this issue · 2 comments

ellisp commented

This query works fine with R 4.2.3:

library(rsdmx)
library(tidyverse)

vaccination <- readSDMX(providerId = "PDH",
                        resource = "data",
                        flowRef = "DF_COVID_VACCINATION") |>
  as_tibble() 

But in 4.3.0 or higher it returns an error

Error in !is.na(obsAttrs.df) && ifelse(is.na(any(obsAttrs.df == "NULL")),  : 
  'length = 2' in coercion to 'logical(1)'

the same error also comes if you use as.data.frame instead of as_tibble

This obviously relatest to the breaking change in R 4.3.0:

CHANGES IN R 4.3.0:

  SIGNIFICANT USER-VISIBLE CHANGES:

    * Calling && or || with LHS or (if evaluated) RHS of length greater
      than one is now always an error, with a report of the form

          'length = 4' in coercion to 'logical(1)'
      
      Environment variable _R_CHECK_LENGTH_1_LOGIC2_ no longer has any
      effect.
ellisp commented

thanks yes it works with the GitHub version