ropensci / taxize

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

tp_search() returns 'names' attribute length error #892

Closed aspidoscelis closed 2 years ago

aspidoscelis commented 2 years ago

Using tp_search() returns "Error in names(key_helpers) <- keynames[1:2] : 'names' attribute [2] must be the same length as the vector [1]". The behavior is consistent across multiple scientific names and name IDs. The same name ID queries made directly to the Tropicos API using GET() work as expected.


# queries

tp_search(nameid="Poa annua")
# Error in names(key_helpers) <- keynames[1:2] : 
#  'names' attribute [2] must be the same length as the vector [1]

tp_search(nameid="25531093", type="exact")
# Error in names(key_helpers) <- keynames[1:2] : 
#  'names' attribute [2] must be the same length as the vector [1]

# session info 

hash: tomato, light bulb, man dancing: dark skin tone

 setting  value
 version  R version 4.0.4 (2021-02-15)
 os       macOS Big Sur 10.16
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Denver
 date     2022-04-21
 rstudio  1.3.1093 Apricot Nasturtium (desktop)
 pandoc   NA

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 ape           5.6-2   2022-03-02 [1] CRAN (R 4.0.5)
 assertthat    0.2.1   2019-03-21 [2] CRAN (R 4.0.2)
 backports     1.2.1   2020-12-09 [2] CRAN (R 4.0.2)
 bold          1.2.0   2021-05-11 [1] CRAN (R 4.0.2)
 broom         0.7.3   2020-12-16 [2] CRAN (R 4.0.2)
 cachem        1.0.6   2021-08-19 [1] CRAN (R 4.0.2)
 callr         3.7.0   2021-04-20 [2] CRAN (R 4.0.2)
 cellranger    1.1.0   2016-07-27 [2] CRAN (R 4.0.2)
 cli           3.1.0   2021-10-27 [1] CRAN (R 4.0.2)
 codetools     0.2-18  2020-11-04 [2] CRAN (R 4.0.4)
 colorspace    2.0-2   2021-06-24 [1] CRAN (R 4.0.2)
 conditionz    0.1.0   2019-04-24 [1] CRAN (R 4.0.2)
 crayon        1.4.2   2021-10-29 [1] CRAN (R 4.0.2)
 crul          1.2.0   2021-11-22 [1] CRAN (R 4.0.2)
 curl          4.3.2   2021-06-23 [1] CRAN (R 4.0.2)
 data.table    1.14.2  2021-09-27 [1] CRAN (R 4.0.2)
 DBI           1.1.2   2021-12-20 [1] CRAN (R 4.0.2)
 dbplyr        2.0.0   2020-11-03 [2] CRAN (R 4.0.2)
 desc          1.4.0   2021-09-28 [2] CRAN (R 4.0.2)
 devtools      2.4.2   2021-06-07 [2] CRAN (R 4.0.2)
 dplyr       * 1.0.7   2021-06-18 [1] CRAN (R 4.0.2)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.0.2)
 fansi         1.0.2   2022-01-14 [1] CRAN (R 4.0.5)
 fastmap       1.1.0   2021-01-25 [2] CRAN (R 4.0.2)
 forcats     * 0.5.0   2020-03-01 [2] CRAN (R 4.0.2)
 foreach       1.5.1   2020-10-15 [1] CRAN (R 4.0.2)
 fs            1.5.2   2021-12-08 [1] CRAN (R 4.0.2)
 generics      0.1.1   2021-10-25 [1] CRAN (R 4.0.2)
 ggplot2     * 3.3.5   2021-06-25 [1] CRAN (R 4.0.2)
 glue          1.6.1   2022-01-22 [1] CRAN (R 4.0.5)
 gtable        0.3.0   2019-03-25 [2] CRAN (R 4.0.2)
 haven         2.3.1   2020-06-01 [2] CRAN (R 4.0.2)
 here          1.0.1   2020-12-13 [2] CRAN (R 4.0.2)
 hms           1.1.1   2021-09-26 [1] CRAN (R 4.0.2)
 httpcode      0.3.0   2020-04-10 [1] CRAN (R 4.0.2)
 httr        * 1.4.2   2020-07-20 [1] CRAN (R 4.0.2)
 iterators     1.0.13  2020-10-15 [1] CRAN (R 4.0.2)
 jsonlite    * 1.8.0   2022-02-22 [1] CRAN (R 4.0.5)
 kewr        * 0.5.2   2021-11-25 [2] Github (barnabywalker/kewr@b85ffbe)
 lattice       0.20-41 2020-04-02 [2] CRAN (R 4.0.4)
 lifecycle     1.0.1   2021-09-24 [1] CRAN (R 4.0.2)
 lubridate     1.8.0   2021-10-07 [1] CRAN (R 4.0.2)
 magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.0.2)
 memoise       2.0.0   2021-01-26 [2] CRAN (R 4.0.2)
 modelr        0.1.8   2020-05-19 [2] CRAN (R 4.0.2)
 munsell       0.5.0   2018-06-12 [2] CRAN (R 4.0.2)
 nlme          3.1-152 2021-02-04 [2] CRAN (R 4.0.4)
 pillar        1.6.5   2022-01-25 [1] CRAN (R 4.0.4)
 pkgbuild      1.2.0   2020-12-15 [2] CRAN (R 4.0.2)
 pkgconfig     2.0.3   2019-09-22 [2] CRAN (R 4.0.2)
 pkgload       1.2.3   2021-10-13 [2] CRAN (R 4.0.2)
 plyr          1.8.6   2020-03-03 [2] CRAN (R 4.0.2)
 prettyunits   1.1.1   2020-01-24 [2] CRAN (R 4.0.2)
 processx      3.5.2   2021-04-30 [2] CRAN (R 4.0.2)
 ps            1.5.0   2020-12-05 [2] CRAN (R 4.0.2)
 purrr       * 0.3.4   2020-04-17 [2] CRAN (R 4.0.2)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.0.2)
 Rcpp          1.0.8   2022-01-13 [1] CRAN (R 4.0.5)
 readr       * 1.4.0   2020-10-05 [2] CRAN (R 4.0.2)
 readxl        1.3.1   2019-03-13 [2] CRAN (R 4.0.2)
 remotes       2.4.1   2021-09-29 [2] CRAN (R 4.0.2)
 reprex        0.3.0   2019-05-16 [2] CRAN (R 4.0.2)
 reshape       0.8.9   2022-04-12 [1] CRAN (R 4.0.4)
 rlang         0.4.12  2021-10-18 [1] CRAN (R 4.0.2)
 rprojroot     2.0.2   2020-11-15 [2] CRAN (R 4.0.2)
 rstudioapi    0.13    2020-11-12 [2] CRAN (R 4.0.2)
 rvest         1.0.2   2021-10-16 [1] CRAN (R 4.0.2)
 scales        1.1.1   2020-05-11 [2] CRAN (R 4.0.2)
 sessioninfo   1.2.1   2021-11-02 [2] CRAN (R 4.0.2)
 stringi       1.7.6   2021-11-29 [1] CRAN (R 4.0.2)
 stringr     * 1.4.0   2019-02-10 [2] CRAN (R 4.0.2)
 taxize      * 0.9.99  2020-10-30 [1] CRAN (R 4.0.2)
 testthat      3.1.0   2021-10-04 [2] CRAN (R 4.0.2)
 tibble      * 3.1.6   2021-11-07 [1] CRAN (R 4.0.2)
 tidyr       * 1.1.4   2021-09-27 [1] CRAN (R 4.0.2)
 tidyselect    1.1.1   2021-04-30 [1] CRAN (R 4.0.2)
 tidyverse   * 1.3.0   2019-11-21 [2] CRAN (R 4.0.2)
 tinytex       0.28    2020-12-14 [2] CRAN (R 4.0.2)
 triebeard     0.3.0   2016-08-04 [1] CRAN (R 4.0.2)
 urltools      1.7.3   2019-04-14 [1] CRAN (R 4.0.2)
 usethis       2.1.3   2021-10-27 [2] CRAN (R 4.0.2)
 utf8          1.2.2   2021-07-24 [1] CRAN (R 4.0.2)
 uuid          1.1-0   2022-04-19 [1] CRAN (R 4.0.4)
 vctrs         0.3.8   2021-04-29 [1] CRAN (R 4.0.2)
 withr         2.4.3   2021-11-30 [1] CRAN (R 4.0.2)
 xfun          0.29    2021-12-14 [1] CRAN (R 4.0.2)
 xml2          1.3.3   2021-11-30 [1] CRAN (R 4.0.2)
 zoo           1.8-8   2020-05-02 [2] CRAN (R 4.0.2)

 [1] /Users/aspidoscelis/Library/R/4.0/library
 [2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

zachary-foster commented 2 years ago

Thanks for the report!

I am currently getting:

> tp_search(nameid="Poa annua")
 Error in tp_GET(url, args, raise = FALSE, ...) : 
500 - a server error occurred, try again later

I assume this is temporary. I will try to reproduce your error again later.

aspidoscelis commented 2 years ago

Greetings, Zachary,

It started working for me without any further intervention on my part, so I guess it was temporary. Thanks!

Regards, Patrick

On 4/21/22 1:22 PM, Zachary Foster wrote:

Thanks for the report!

I am currently getting:

tp_search(nameid="Poa annua") Error in tp_GET(url,args,raise = FALSE,...):
500 - a server error occurred,try again later

I assume this is temporary. I will try to reproduce your error again later.

— Reply to this email directly, view it on GitHub https://github.com/ropensci/taxize/issues/892#issuecomment-1105664201, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOENOSJZNBGNBPBLEIA5ILVGGTH3ANCNFSM5T75YQRA. You are receiving this because you authored the thread.Message ID: @.***>

zachary-foster commented 2 years ago

Ok, thanks for letting me know!