Package rgbif version 3.7.9
Usage
occ_download_import(
x = NULL,
key = NULL,
path = ".",
fill = FALSE,
encoding = "UTF-8",
...
)
as.download(path = ".", key = NULL)
## S3 method for class 'character'
as.download(path = ".", key = NULL)
## S3 method for class 'download'
as.download(path = ".", key = NULL)
Arguments
参数【x】:调用occ_download_get的输出
参数【key】:从请求生成的密钥,如occ_download
参数【path】:解压缩文件到的路径。默认值:“.”,写入与zip文件名匹配的文件夹
参数【fill】:(逻辑值)(默认FALSE)如果为TRUE,则在行长度不等的情况下,隐式填充空白字段。传递给data.table:: read中的填充参数。
参数【encoding】:(字符)读取数据的编码;传递给data.table:: read()。默认值:“utf - 8”。其他允许的选项:“Latin-1”和“unknown”。
参数【...】:传递给data.table::fread()的参数。有关详细信息,请参阅阅读文档。这里可能特别有用的一些读取参数有:select(选择要读取的列;其他被删除),nrows(只读取一定数量的行)
Details
您可以提供x作为输入,也可以同时提供key和path。我们在内部使用data.table:: read()来读取数据。
Value
a tibble (data.frame)
Problems reading data
使用occ_download_import()时可能会遇到错误;大多数情况下,这是由于data.table:: fread()无法正确解析occurrence.txt文件。fill参数向下传递给data.table::fread()和…允许您传递data.table::fread()接受的任何其他参数。
countryCode result column and Namibia
纳米比亚的国家代码是“NA”。不幸的是,在R中,“NA”字符串将被读入R作为NA/缺失。为了避免这种情况,在这个函数中,我们读入数据,然后将NA/缺失值转换为字符串“NA”。当国家代码确实缺失时,它将是一个空字符串。
Examples
res <- occ_download_get(key="0000066-140928181241064", overwrite=TRUE)
occ_download_import(res)
occ_download_get(key="0000066-140928181241064", overwrite = TRUE) %>%
occ_download_import