不久前在《生物多样性》杂志上看到一个获取中国物种名录的R 包:SP2000, 基于中国物种2000节点,该数据库每年更新,获取的物种名录应该是比较新的。
原文章地址:https://www.biodiversity-science.net/CN/10.17520/biods.2020235
DOI: 10.17520/biods.2020235
# SP2000 package usage
library(SP2000)
library(purrr)
library(tidyverse)
# define all the taxon we want to retrieve
China_carnivora <- tribble(~ family_names, "Ailuridea","Canidae","Felidae","Herpestidae","Mustelidae","Otariidae","Phocidae","Ursidae","Viverridae")
my_species2000_key <- "input your key"
set_search_key(my_species2000_key)
# retrieve the unique ID
pre_result_family <- China_carnivora %>% mutate(., SP2000_pull = map(family_names, search_family_id))
pre_result_family_result_clean <- pre_result_family %>%
mutate(., family_id = purrr::map_chr(SP2000_pull, # select the "SP2000" column
pluck, # pluck function in purrr
1, # pluck the first level
"data", # continue sort the next level data
"record_id")) %>% # sort the data in the column "record_id"
dplyr::select(family_names, family_id) # select the two column
# we can use "search_taxon_id" after "search_family_id"
pos_result_species <-
purrr::map(pre_result_family_result_clean$family_id, search_taxon_id, name = "familyID", mc.cores = 6) %>%
purrr::map_df(., pluck, 1, "data") %>%
dplyr::select(chineseName, scientificName, taxonTree)
write.csv(pos_result_species,"pos_result_species.csv")
水平有限,如有误欢迎批评指正