Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downto error #885

Open
rogmei opened this issue Nov 1, 2021 · 1 comment
Open

Downto error #885

rogmei opened this issue Nov 1, 2021 · 1 comment

Comments

@rogmei
Copy link

rogmei commented Nov 1, 2021

Hi, I really find the taxize package useful, but now I am encountering a bug that seems to be similar to those found in cases #847, #824 and #821. This is related to finding all species in the group Osteichthyes. Other groups like Agnatha and Chondrichthyes works fine. Libraries tidyverse, taxize and rentrez are loaded.

Code snippet that fails is as follows:
var_output_taxrank = "species"
var_input_taxranks <- c('Osteichthyes')
options(max.print = 1000000)
wi <- bind_rows(get_wormsid_(sci_com = c(var_input_taxranks), searchtype = "scientific", marine_only = TRUE))
downstream(sci_id = as_vector(select(wi, AphiaID)), db = 'worms', downto = var_output_taxrank, intermediate = FALSE ) %>%
data.table::rbindlist() -> wormsids_atrank

Error message:
Error in vapply(x$rank, function(z) which_rank(z, zoo = zoo), 1) :
values must be length 1,
but FUN(X[[1]]) result is length 0

@zachary-foster
Copy link
Collaborator

Thanks for the info! This was caused by the rank "gigaclass" not being in the rank reference used to determine the relative order of taxonomic ranks from names. I have added the "gigaclass" to the rank ref and made a more informative error message for when this happens again. You can try out the change by installing this version that will be pushed to CRAN soon hopefully, but note this version has many other changes and might break other code.

install.packages("remotes")
remotes::install_github("ropensci/taxize")

zachary-foster added a commit that referenced this issue Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants