ropensci / taxize

A taxonomic toolbelt for R
https://docs.ropensci.org/taxize
Other
264 stars 58 forks source link

taxize::synonyms return error "The `x` argument of `as_tibble()` can't be missing as of tibble 3.0.0." #922

Open gledits2 opened 7 months ago

gledits2 commented 7 months ago
Session Info ```r R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045) Matrix products: default locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C [5] LC_TIME=English_United States.utf8 time zone: America/New_York tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] taxize_0.9.100 caribmacro_1.1.0 here_1.0.1 loaded via a namespace (and not attached): [1] gtable_0.3.4 ggplot2_3.4.3 lattice_0.21-8 vctrs_0.6.3 tools_4.3.1 generics_0.1.3 curl_5.0.2 parallel_4.3.1 [9] tibble_3.2.1 proxy_0.4-27 fansi_1.0.4 pkgconfig_2.0.3 KernSmooth_2.23-21 data.table_1.14.8 uuid_1.1-1 lifecycle_1.0.3 [17] conditionz_0.1.0 compiler_4.3.1 stringr_1.5.0 munsell_0.5.0 ritis_1.0.0 codetools_0.2-19 class_7.3-22 lazyeval_0.2.2 [25] pillar_1.9.0 crayon_1.5.2 whisker_0.4.1 classInt_0.4-9 solrium_1.2.0 iterators_1.0.14 foreach_1.5.2 nlme_3.1-162 [33] tidyselect_1.2.0 digest_0.6.33 stringi_1.7.12 sf_1.0-14 dplyr_1.1.3 rprojroot_2.0.3 grid_4.3.1 colorspace_2.1-0 [41] cli_3.6.1 magrittr_2.0.3 bold_1.3.0 triebeard_0.4.1 crul_1.4.0 utf8_1.2.3 e1071_1.7-13 ape_5.7-1 [49] scales_1.2.1 oai_0.4.0 httr_1.4.7 rgbif_3.7.7 zoo_1.8-12 rlang_1.1.1 urltools_1.7.3 Rcpp_1.0.11 [57] glue_1.6.2 DBI_1.1.3 httpcode_0.3.0 xml2_1.3.5 rstudioapi_0.15.0 jsonlite_1.8.7 R6_2.5.1 plyr_1.8.8 [65] units_0.8-3 ```

Hi,

I am trying to look up the known synonyms for a list of species. In the past, I have used taxize::synonyms with great success. However, now when I run the following code, I get an error about a tibble not being able to be made because a parameter is needed as of tibble 3.0.0.

Here is the code I am trying to run:

synonyms(sci_id = 'Ameiva atrigularis', db = 'itis')

And this is the output I get with the traceback

══ 1 queries ═══════════════

Retrieving data for taxon 'Ameiva atrigularis'

Error: ! The x argument of as_tibble() can't be missing as of tibble 3.0.0. Run rlang::last_trace() to see where the error occurred.

rlang::last_trace() <error/lifecycle_error_deprecated> Error: ! The x argument of as_tibble() can't be missing as of tibble 3.0.0.

Backtrace: ▆

  1. ├─taxize::synonyms(sci_id = corect_name$matched_name2, db = "itis")
  2. └─taxize:::synonyms.default(...)
  3. └─taxize:::process_syn_ids(sci_id, db, get_tsn, rows = rows, ...)
  4. └─eval(fxn)(input, ...)
  5. └─ritis::terms(sci_com[i], what = searchtype, ...)
  6. └─base::lapply(query, fun, wt = wt, raw = raw, ...)
  7. └─ritis (local) FUN(X[[i]], ...)
  8. └─ritis:::parse_raw(out)
  9. ├─tibble::as_tibble()
  10. └─tibble:::as_tibble.NULL()
  11. └─lifecycle::deprecate_stop("3.0.0", "as_tibble(x = 'can\'t be missing')")
  12. └─lifecycle:::deprecate_stop0(msg) Run rlang::last_trace(drop = FALSE) to see 1 hidden frame.

I tried to run it again after reinstalling taxize through remotes::install_github("ropensci/taxize") and it still returned the same error. The interesting this is that I ran this code in September without issue.

zachary-foster commented 7 months ago

Thanks! I am unable to reproduce this error. Can you add a sessionInfo() output?

library(taxize)
synonyms(sci_id = 'Ameiva atrigularis', db = 'itis')
#> ══  1 queries  ═══════════════
#> 
#> Retrieving data for taxon 'Ameiva atrigularis'
#> ✔  Found:  Ameiva atrigularis
#> ══  Results  ═════════════════
#> 
#> • Total: 1 
#> • Found: 1 
#> • Not Found: 0
#> $`Ameiva atrigularis`
#> data frame with 0 columns and 0 rows
#> 
#> attr(,"class")
#> [1] "synonyms"
#> attr(,"db")
#> [1] "itis"
sessionInfo()
#> R version 4.3.2 (2023-10-31)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Pop!_OS 22.04 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: America/Los_Angeles
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] taxize_0.9.100
#> 
#> loaded via a namespace (and not attached):
#>  [1] bold_1.3.0        solrium_1.2.0     jsonlite_1.8.7    dplyr_1.1.4      
#>  [5] compiler_4.3.2    crayon_1.5.2      tidyselect_1.2.0  reprex_2.0.2     
#>  [9] Rcpp_1.0.11       xml2_1.3.5        urltools_1.7.3    parallel_4.3.2   
#> [13] triebeard_0.4.1   yaml_2.3.7        fastmap_1.1.1     lattice_0.22-5   
#> [17] plyr_1.8.9        R6_2.5.1          generics_0.1.3    curl_5.1.0       
#> [21] knitr_1.45        iterators_1.0.14  tibble_3.2.1      ritis_1.0.0      
#> [25] crul_1.4.0        pillar_1.9.0      rlang_1.1.2       utf8_1.2.4       
#> [29] httpcode_0.3.0    stringi_1.8.2     xfun_0.41         fs_1.6.3         
#> [33] cli_3.6.1         magrittr_2.0.3    withr_2.5.2       digest_0.6.33    
#> [37] foreach_1.5.2     grid_4.3.2        rstudioapi_0.15.0 lifecycle_1.0.4  
#> [41] nlme_3.1-163      vctrs_0.6.4       evaluate_0.23     glue_1.6.2       
#> [45] data.table_1.14.8 codetools_0.2-19  zoo_1.8-12        fansi_1.0.5      
#> [49] ape_5.7-1         rmarkdown_2.25    pkgconfig_2.0.3   tools_4.3.2      
#> [53] htmltools_0.5.7

Created on 2023-11-30 with reprex v2.0.2

gledits2 commented 7 months ago

Hi, Thanks for the reply!

The session info is in the original post. I also pasted it below.

One thing I noticed from your session info is that we are using the same tibble package version so I am at a complete loss for why this error is occurring for me. I will try on a new machine tonight and let you know if I have better luck.

Session Info: `R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/New_York tzcode source: internal

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

other attached packages: [1] taxize_0.9.100 caribmacro_1.1.0 here_1.0.1

loaded via a namespace (and not attached): [1] gtable_0.3.4 ggplot2_3.4.3 lattice_0.21-8 vctrs_0.6.3 tools_4.3.1 generics_0.1.3 curl_5.0.2 parallel_4.3.1
[9] tibble_3.2.1 proxy_0.4-27 fansi_1.0.4 pkgconfig_2.0.3 KernSmooth_2.23-21 data.table_1.14.8 uuid_1.1-1 lifecycle_1.0.3
[17] conditionz_0.1.0 compiler_4.3.1 stringr_1.5.0 munsell_0.5.0 ritis_1.0.0 codetools_0.2-19 class_7.3-22 lazyeval_0.2.2
[25] pillar_1.9.0 crayon_1.5.2 whisker_0.4.1 classInt_0.4-9 solrium_1.2.0 iterators_1.0.14 foreach_1.5.2 nlme_3.1-162
[33] tidyselect_1.2.0 digest_0.6.33 stringi_1.7.12 sf_1.0-14 dplyr_1.1.3 rprojroot_2.0.3 grid_4.3.1 colorspace_2.1-0
[41] cli_3.6.1 magrittr_2.0.3 bold_1.3.0 triebeard_0.4.1 crul_1.4.0 utf8_1.2.3 e1071_1.7-13 ape_5.7-1
[49] scales_1.2.1 oai_0.4.0 httr_1.4.7 rgbif_3.7.7 zoo_1.8-12 rlang_1.1.1 urltools_1.7.3 Rcpp_1.0.11
[57] glue_1.6.2 DBI_1.1.3 httpcode_0.3.0 xml2_1.3.5 rstudioapi_0.15.0 jsonlite_1.8.7 R6_2.5.1 plyr_1.8.8
[65] units_0.8-3 `

zachary-foster commented 7 months ago

Oh, sorry, I did not see it at first. That is odd. Another person with a similar error also had the same tibble version, so there is something going on. I tried both the Github and CRAN version and did not get an error with either.

labmizrahi commented 6 months ago

I have the same issue, any updates?

sessionInfo:

R version 4.1.2 (2021-11-01) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS 14.1.2

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages: [1] lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2 readr_2.1.4
[7] tidyr_1.3.0 tibble_3.2.1 ggplot2_3.4.4 tidyverse_2.0.0 taxize_0.9.100

loaded via a namespace (and not attached): [1] zoo_1.8-12 tidyselect_1.2.0 lattice_0.22-5 V8_4.4.0 colorspace_2.1-0
[6] vctrs_0.6.4 generics_0.1.3 utf8_1.2.4 rlang_1.1.2 pillar_1.9.0
[11] glue_1.6.2 httpcode_0.3.0 withr_2.5.2 solrium_1.2.0 bit64_4.0.5
[16] randomcoloR_1.1.0.1 uuid_1.1-1 plyr_1.8.9 foreach_1.5.2 lifecycle_1.0.4
[21] munsell_0.5.0 gtable_0.3.4 codetools_0.2-19 tzdb_0.4.0 curl_5.1.0
[26] parallel_4.1.2 fansi_1.0.5 triebeard_0.4.1 urltools_1.7.3 broom_1.0.5
[31] Rcpp_1.0.11 backports_1.4.1 scales_1.2.1 vroom_1.6.4 jsonlite_1.8.7
[36] bit_4.0.5 hms_1.1.3 digest_0.6.33 stringi_1.8.2 Rtsne_0.16
[41] ritis_1.0.0 ade4_1.7-22 grid_4.1.2 cli_3.6.1 tools_4.1.2
[46] magrittr_2.0.3 bold_1.3.0 cluster_2.1.4 crul_1.4.0 crayon_1.5.2
[51] ape_5.7-1 seqinr_4.2-30 pkgconfig_2.0.3 MASS_7.3-60 data.table_1.14.8
[56] xml2_1.3.5 timechange_0.2.0 rstudioapi_0.15.0 iterators_1.0.14 R6_2.5.1
[61] conditionz_0.1.0 nlme_3.1-162 compiler_4.1.2

andrewdeines commented 4 months ago

Also the same issue, any progress?

R version 4.3.2 (2023-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

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

time zone: America/Los_Angeles tzcode source: internal

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

other attached packages: [1] taxize_0.9.100

loaded via a namespace (and not attached): [1] bold_1.3.0 solrium_1.2.0 jsonlite_1.8.8 dplyr_1.1.4 compiler_4.3.2
[6] crayon_1.5.2 tidyselect_1.2.0 Rcpp_1.0.12 xml2_1.3.6 urltools_1.7.3
[11] parallel_4.3.2 triebeard_0.4.1 uuid_1.2-0 lattice_0.22-5 plyr_1.8.9
[16] R6_2.5.1 generics_0.1.3 curl_5.2.0 iterators_1.0.14 tibble_3.2.1.9016 [21] ritis_1.0.0 crul_1.4.0 pillar_1.9.0 rlang_1.1.3 utf8_1.2.4
[26] httpcode_0.3.0 stringi_1.8.3 cli_3.6.2 magrittr_2.0.3 digest_0.6.34
[31] foreach_1.5.2 grid_4.3.2 rstudioapi_0.15.0 lifecycle_1.0.4 nlme_3.1-164
[36] vctrs_0.6.5 glue_1.7.0 data.table_1.15.0 codetools_0.2-19 zoo_1.8-12
[41] ape_5.7-1 fansi_1.0.6 conditionz_0.1.0 tools_4.3.2 pkgconfig_2.0.3

andrewdeines commented 4 months ago

same outcome with different architecture:

synonyms(sci_id = 'Ameiva atrigularis', db = 'itis')

sessionInfo() R version 4.2.1 (2022-06-23) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Ventura 13.6.3

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages: [1] taxize_0.9.100

loaded via a namespace (and not attached): [1] Rcpp_1.0.10 plyr_1.8.8 compiler_4.2.1 pillar_1.9.0
[5] ritis_1.0.0 iterators_1.0.14 tools_4.2.1 uuid_1.1-0
[9] jsonlite_1.8.7 lifecycle_1.0.3 tibble_3.2.1 nlme_3.1-157
[13] lattice_0.20-45 pkgconfig_2.0.3 rlang_1.1.1 foreach_1.5.2
[17] cli_3.6.1 rstudioapi_0.13 crul_1.4.0 curl_4.3.2
[21] parallel_4.2.1 dplyr_1.1.2 xml2_1.3.3 generics_0.1.3
[25] vctrs_0.6.3 triebeard_0.4.1 grid_4.2.1 tidyselect_1.2.0 [29] glue_1.6.2 httpcode_0.3.0 data.table_1.14.2 R6_2.5.1
[33] fansi_1.0.4 conditionz_0.1.0 solrium_1.2.0 magrittr_2.0.3
[37] urltools_1.7.3 codetools_0.2-18 bold_1.3.0 ape_5.6-2
[41] utf8_1.2.3 stringi_1.7.12 crayon_1.5.1 zoo_1.8-11

andrewdeines commented 4 months ago

Discovered this is what happens when the ITISWebService is down. See https://github.com/ropensci/ritis/issues/26