LimaRAF / plantR

An R Package for Managing Species Records from Biological Collections
GNU General Public License v3.0
18 stars 4 forks source link

Issue on prepSpecies when using plantRdata::wfoNames and plantRdata::wcvpNames #114

Closed ggrittz closed 1 month ago

ggrittz commented 1 month ago

Hi, I am encountering the following issue:

to_git <- plantR::prepSpecies(x = to_git,
                              tax.names = "spec.name",
                              use.authors = FALSE,
                              db = plantRdata::wcvpNames,
                              replace.names = FALSE)
Error in apply(names.new, 2, function(x) paste(x, collapse = "|")) : 
  dim(X) deve ter um comprimento positive

The same occurs when using plantRdata::wfoNames. Also, I thought the issue could be on replace.names = FALSE, but it is also occurring in replace.names = TRUE.

The issue appears to be on plantRdata wfoNames and wcvpNames because for plantR::bfoNames It works normally (with or without replacing names).

Here is the reproducible rds.

LimaRAF commented 1 month ago

Hi thanks for the issue.

This was coming from a simple bug when having only one or multiple entries with multiple matches.

I rerun your codes with the same example dataset (thanks!) after the changes (in this commit) and I could no longer reproduce the error.

Please reinstall the package from the dev branch and see if this is also the case for you. If this is not the case, please reopen this issue.