OECD icon indicating copy to clipboard operation
OECD copied to clipboard

Error using OECD::get_data_structure(dataset = 'RS_GBL')

Open luifrancgom opened this issue 1 year ago • 2 comments

I am using the package OECD to extract data from the Global Revenue Statistics Database. I already know the id for this database but I get the following error:

library(OECD)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(stringr)

dataset_list <- OECD::get_datasets()

dataset_list |> 
  dplyr::filter(stringr::str_detect(title, 
                                    pattern='Global Revenue Statistics Database'))
#> # A tibble: 1 × 2
#>   id     title                             
#>   <chr>  <chr>                             
#> 1 RS_GBL Global Revenue Statistics Database

OECD::get_data_structure(dataset = 'RS_GBL')
#> Error in data_structure@concepts: no applicable method for `@` applied to an object of class "data.frame"

Created on 2023-07-18 with reprex v2.0.2

The information of my current R session is the following:

sessionInfo()
#> R version 4.3.1 (2023-06-16 ucrt)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 11 x64 (build 22621)
#> 
#> Matrix products: default
#> 
#> 
#> locale:
#> [1] LC_COLLATE=English_United States.utf8 
#> [2] LC_CTYPE=English_United States.utf8   
#> [3] LC_MONETARY=English_United States.utf8
#> [4] LC_NUMERIC=C                          
#> [5] LC_TIME=English_United States.utf8    
#> 
#> time zone: America/Bogota
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] stringr_1.5.0 dplyr_1.1.2   OECD_0.2.5   
#> 
#> loaded via a namespace (and not attached):
#>  [1] vctrs_0.6.3       cli_3.6.1         knitr_1.43        rlang_1.1.1      
#>  [5] xfun_0.39         stringi_1.7.12    purrr_1.0.1       styler_1.10.1    
#>  [9] generics_0.1.3    glue_1.6.2        htmltools_0.5.5   fansi_1.0.4      
#> [13] rmarkdown_2.23    R.cache_0.16.0    tibble_3.2.1      evaluate_0.21    
#> [17] fastmap_1.1.1     yaml_2.3.7        lifecycle_1.0.3   compiler_4.3.1   
#> [21] fs_1.6.2          pkgconfig_2.0.3   rstudioapi_0.15.0 R.oo_1.25.0      
#> [25] R.utils_2.12.2    digest_0.6.33     R6_2.5.1          tidyselect_1.2.0 
#> [29] utf8_1.2.3        reprex_2.0.2      pillar_1.9.0      magrittr_2.0.3   
#> [33] R.methodsS3_1.8.2 tools_4.3.1       withr_2.5.0

Created on 2023-07-18 with reprex v2.0.2

luifrancgom avatar Jul 19 '23 03:07 luifrancgom

I get the same error with the CRAN version, but the latest version installed from the github seems to work.

jhuovari avatar Aug 04 '23 11:08 jhuovari

This matter was thoroughly examined in issue #25 and successfully resolved by adding dependencies tied to the tibble, purrr, and dplyr. To optimize the solution and streamline dependencies, it's essential to incorporate a base R function as it is recommended in #25. Additionally, as indicated in issue #25, an update to the repository is necessary to accurately mirror the current status on CRAN. A related problem is also mention in #21

luifrancgom avatar Aug 05 '23 20:08 luifrancgom