You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the function gnr_resolve(), I never obtain the same matched name for multiple user-supplied names - even when doing so would lead to a clearly better match. These erroneous matches persist even in single-species gnr_resolve()queries.
Evidently, the best match for Lagopus matu (first row in the output) should be Lagopus muta as has been matched correctly in row four. Additionally, the matches to Lagopus lagopus (row 3) and Lagopas lagopus (row 5) ought to be the same - Lagopus lagopus.
Interestingly, even when running the gnr_resolve()function only on just the first species:
gnr_resolve(sci=sps[1], best_match_only=TRUE)
still results in the same erroneous match as above:
# A tibble: 1 × 5
user_supplied_name submitted_name matched_name data_source_title score
* <chr> <chr> <chr> <chr> <dbl>
1 Lagopus matu Lagopus matu Lagopus Brisson, 1760 Catalogue of Life Che… 0.75
Workaround
For now, I have put together a workaround with the rgbif package:
library(rgbif)
Fixed_Species<- sapply(sps, # loop over species namesFUN=function(x){
gbif_resolve<-rgbif::name_backbone_verbose(x) # retrieve gbif backbone matches
ifelse(gbif_resolve$data$matchType!="NONE",
gbif_resolve$data$canonicalName[1], # if match has been made, then pull matched canonical namegbif_resolve$alternatives$canonicalName# if no match, then pull out alternative matches from fuzzy matching
)
}
)
The Issue
Using the function
gnr_resolve()
, I never obtain the same matched name for multiple user-supplied names - even when doing so would lead to a clearly better match. These erroneous matches persist even in single-speciesgnr_resolve()
queries.Minimal Working Example
Running this code:
results in this output:
Evidently, the best match for Lagopus matu (first row in the output) should be Lagopus muta as has been matched correctly in row four. Additionally, the matches to Lagopus lagopus (row 3) and Lagopas lagopus (row 5) ought to be the same - Lagopus lagopus.
Interestingly, even when running the
gnr_resolve()
function only on just the first species:still results in the same erroneous match as above:
Workaround
For now, I have put together a workaround with the
rgbif
package:which, to me, leads to the expected matches:
Session Info
The text was updated successfully, but these errors were encountered: