我已使用
rgbif
包成功下载了发生数据。然而,可用的属性似乎受到限制。具体来说,我想要:栖息地、识别备注和发生备注。有没有办法通过 R 获取该信息?
library(rgbif)
# Request data
occ_download(pred_and(pred("phylumKey", 35), pred("gadm","ETH")),
format = "SIMPLE_CSV")
# Check download status using occurrence number,
# see result in console from previous step
occ_download_wait("download occurrence number")
# Load data
df <- occ_download_get("download occurrence number") %>%
occ_download_import()
探索数据:没有栖息地等属性
names(df)
[1] "gbifID" "datasetKey" "occurrenceID" "kingdom"
[5] "phylum" "class" "order" "family"
[9] "genus" "species" "infraspecificEpithet" "taxonRank"
[13] "scientificName" "verbatimScientificName" "verbatimScientificNameAuthorship" "countryCode"
[17] "locality" "stateProvince" "occurrenceStatus" "individualCount"
[21] "publishingOrgKey" "decimalLatitude" "decimalLongitude" "coordinateUncertaintyInMeters"
[25] "coordinatePrecision" "elevation" "elevationAccuracy" "depth"
[29] "depthAccuracy" "eventDate" "day" "month"
[33] "year" "taxonKey" "speciesKey" "basisOfRecord"
[37] "institutionCode" "collectionCode" "catalogNumber" "recordNumber"
[41] "identifiedBy" "dateIdentified" "license" "rightsHolder"
[45] "recordedBy" "typeStatus" "establishmentMeans" "lastInterpreted"
[49] "mediaType" "issue"
感谢@Grzegorz Sapijaszko 的评论,我能够解决这个问题。我请求使用
SIMPLE_CSV
作为下载的文件格式(就像我遵循的许多教程一样)。然而,SIMPLE_CSV
可用的属性数量是有限的。要获取所有可用数据,请使用 DWCA
作为下载方法。这会将数据下载到一个文件夹中的多个单独的文本文件中。
这是更新后的代码(也是一个简单的调整,通过将下载数量保存到 res
对象中,并将门更改为物种较少的门,以加快示例速度,从而使其更容易重现)。
library(rgbif)
# Request data
res<-occ_download(pred_and(pred("phylumKey", 13), pred("gadm","ETH")),
format = "DWCA")#!!!! change SIMPLE_CSV to DWCA
# Check download status using occurrence number,
# see result in console from previous step
occ_download_wait(res)
# Load data
df <- occ_download_get(res) %>%
occ_download_import()