occ_download_import: Import a downloaded file from GBIF.

Description Usage Arguments Details Value Note Examples

View source: R/occ_download_import.R

Description

Import a downloaded file from GBIF.

Usage

1
2
3
4
5
6
7
8
9
occ_download_import(x = NULL, key = NULL, path = ".", fill = TRUE, ...)

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

The output of a call to occ_download_get

key

A key generated from a request, like that from occ_download

path

Path to unzip file to. Default: "." Writes to folder matching zip file name

fill

(logical) (default: FALSE). If TRUE then in case the rows have unequal length, blank fields are implicitly filled. passed on to fill parameter in data.table::fread. If you get problems with this function crashing it could be due to data.table failing, in which case try setting fill=FALSE

...

parameters passed on to data.table::fread()

Details

You can provide either x as input, or both key and path. We use data.table::fread() internally to read data.

Value

a tibble (data.frame)

Note

see downloads for an overview of GBIF downloads methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# First, kick off at least 1 download, then wait for the job to be complete
# Then use your download keys
res <- occ_download_get(key="0000066-140928181241064", overwrite=TRUE)
occ_download_import(res)

occ_download_get(key="0000066-140928181241064", overwrite = TRUE) %>%
  occ_download_import

# coerce a file path to the right class to feed to occ_download_import
# as.download("0000066-140928181241064.zip")
# as.download(key = "0000066-140928181241064")
# occ_download_import(as.download("0000066-140928181241064.zip"))

# download a dump that has a CSV file
# res <- occ_download_get(key = "0001369-160509122628363", overwrite=TRUE)
# occ_download_import(res)
# occ_download_import(key = "0001369-160509122628363")

## End(Not run)

rgbif documentation built on July 7, 2018, 9:03 a.m.