Hi all,
As you might know, if you are a R user, "name_suggest" function of rgbif package is useful to obtain the taxon ID.
library(rgbif)
#for a species, ID only
name_suggest("Syncerus caffer caffer")$key
#the code need to be as follows for older versions (add $data)
#name_suggest("Syncerus caffer caffer")$data$key
#full search results
name_suggest("Syncerus caffer caffer")
#for multiple species
sname <- list("Syncerus caffer caffer","Juniperus blancoi")
sapply(sname, function(x){name_suggest(x)$key})
#it returns multiple IDs for Juniperus blancoi
name_suggest("Juniperus blancoi")
# A tibble: 4 × 3
# key canonicalName rank
# <int> <chr> <chr>
#1 2684495 Juniperus blancoi SPECIES
#2 2684498 Juniperus blancoi huehuentensis VARIETY
#3 2684496 Juniperus blancoi mucronata VARIETY
#4 7071103 Juniperus blancoi blancoi VARIETY
#if you would like a result for "species" level, you can specify as follows
name_suggest("Juniperus blancoi", rank='species')
Best,
Fumiko
________________________________________
差出人:
genetic-indic...@googlegroups.com <
genetic-indic...@googlegroups.com> が Deon de Jager <
deja...@gmail.com> の代理で送信
送信日時: 2022年11月10日 6:45
宛先: Genetic indicators project
件名: Re: GBIF TaxonID
--
You received this message because you are subscribed to the Google Groups "Genetic indicators project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
genetic-indicators-...@googlegroups.com<mailto:
genetic-indicators-...@googlegroups.com>.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/genetic-indicators-project/f64086e6-0ea8-428e-8f5e-e7f44ad3a572n%40googlegroups.com<
https://groups.google.com/d/msgid/genetic-indicators-project/f64086e6-0ea8-428e-8f5e-e7f44ad3a572n%40googlegroups.com?utm_medium=email&utm_source=footer>.