rOpenGov / eurostat

R tools for Eurostat data
http://ropengov.github.io/eurostat
Other
234 stars 46 forks source link

Error in `get_eurostat_toc()`: Issues with Assigning Data to `toc$title` #306

Closed sweingwifo closed 1 month ago

sweingwifo commented 1 month ago

Description: While attempting to use the get_eurostat_toc() function from the eurostat package to retrieve the table of contents (TOC) from Eurostat, I encountered an error related to assigning data to toc$title. This issue prevents the successful retrieval and conversion of the TOC into a data table format.

Error Message:

Error in `$<-`: Assigned data `toc_determine_hierarchy(.eurostatTOC$title)` must be compatible with existing data.
✖ Existing data has 966 rows.
✖ Assigned data has 0 rows.
ℹ Only vectors of size 1 are recycled.
Caused by error in `vectbl_recycle_rhs_rows()`:
! Can't recycle input of size 0 to size 966.

Backtrace:

1. ├─data.table::as.data.table(get_eurostat_toc())
2. └─eurostat::get_eurostat_toc()
3.   └─eurostat:::set_eurostat_toc(lang = lang)
4.     ├─base::`$<-`(`*tmp*`, "hierarchy", value = `<dbl>`)
5.     └─tibble:::`$<-.tbl_df`(`*tmp*`, "hierarchy", value = `<dbl>`)
6.       └─tibble:::tbl_subassign(...)
7.         └─tibble:::vectbl_recycle_rhs_rows(value, fast_nrow(xo), i_arg = NULL, value_arg, call)

Steps to Reproduce:

  1. Install and load the latest version of the eurostat package.
  2. Attempt to retrieve the TOC using toc = get_eurostat_toc().

Expected Behavior: The function should retrieve the TOC from Eurostat and convert it into a data table without any errors.

Actual Behavior: The function fails with an error related to data assignment, specifically when trying to assign data to toc$title.

Environment:

Additional Context:

sweingwifo commented 1 month ago

I realized that the problem was resolved by updating the packages to the latest version. It appears that I had overlooked to restart my R session after performing the updates.

Sorry for any inconvenience!

antagomir commented 1 month ago

Great!