Downloads a packaged gbif4crest release hosted on Figshare and saves it as a local .zip file.

dbDownload(
  filename = "gbif4crest_03.zip",
  version = 3,
  lite = TRUE,
  res = "5min",
  timeout = 10000,
  overwrite = TRUE,
  quiet = FALSE,
  max_tries = 3
)

Arguments

filename

Character. Destination file path for the downloaded archive. If it has no .zip extension, .zip is appended. If left as the default "gbif4crest_03.zip", it is replaced by the appropriate release filename.

version

Integer. Dataset major version. Currently supported: 2 or 3.

lite

Logical. Only relevant for version = 2 and res = "15min". If TRUE, downloads the curated/lite variant when available. Ignored for version = 3.

res

Character. Spatial resolution. One of "15min" or "5min". Note: version = 3 is currently available only as "5min".

timeout

Numeric. Maximum time in seconds for the transfer (passed to libcurl).

overwrite

Logical. If TRUE, overwrite an existing filename. If FALSE, an existing file triggers an error.

quiet

Logical. If TRUE, suppresses the download progress meter.

max_tries

Integer. Maximum number of attempts for transient failures. (Most issues should not require retries when using the API endpoint.)

Value

Invisibly returns the absolute path to the downloaded file.

Examples

if (FALSE) { # \dontrun{
# Default: v3 5min
dbDownload()

# Version 2, 15min lite
dbDownload(version = 2, res = "15min", lite = TRUE)

# Save to a custom location
dbDownload(filename = "data/gbif4crest.zip", quiet = FALSE)
} # }