Skip to contents

Runs the SQL query of gbif_effort_sql() as a GBIF download (package rgbif >= 3.8). A GBIF account is needed, and its credentials must be stored as environment variables, never in your scripts: run file.edit("~/.Renviron") (or usethis::edit_r_environ()), add the three lines

GBIF_USER=your_user_name
GBIF_PWD=your_password
GBIF_EMAIL=your_email

and restart R. SQL downloads are marked experimental by GBIF; if your account is refused, download the target-group species normally and count records per cell instead. Large extents can take an hour or more. Cite the DOI written to effort_download_DOI.txt.

Usage

download_gbif_effort(sql, path, wait = TRUE)

Arguments

sql

Query from gbif_effort_sql() or gbif_target_group_sql().

path

Folder for the download and the table (re-used: an existing effort_table.csv is returned without downloading again).

wait

Wait for GBIF to finish (status checked every minute).

Value

The path of effort_table.csv (or, with wait = FALSE, the download key).

Examples

if (FALSE) { # \dontrun{
q <- gbif_effort_sql(c(-32, 75, 34, 82), target = c("Silene acaulis"))
tab <- download_gbif_effort(q, "gbif_effort")
eff <- gbif_effort_rasters(tab, c(-32, 75, 34, 82))
} # }