gbif_dl: Use rgbif to get a citable GBIF download

Description Usage Arguments Details Author(s) Examples

View source: R/grab.R

Description

This function requests data from the GBIF database for one taxon or a list of taxa using the rgbif access to the GBIF API. The raw data are stored and a reformatted data frame is returned that is compatible with downstream cRacle functions.

Usage

1
2
3
4
5
6
7
8
9
gbif_dl(
  taxa,
  kingdom = "all",
  dir.out = "gbif_dl",
  maxrec = Inf,
  gbif_user = "",
  gbif_pw = "",
  gbif_email = ""
)

Arguments

taxa

A string of the form 'genus species' or 'genus', or a vector of several names in this form.

kingdom

Specify ONE taxonomic kingdom for this query. Valid strings are "all", or kingdom names as defined in the GBIF taxonomy.

dir.out

Path to your output directory

maxrec

Maximum number of records to download.

gbif_user

Your GBIF username

gbif_pw

Your GBIF password

gbif_email

Your GBIF email

Details

Set up a GBIF account for access to downloads before using this function. Then you may either pass your username (gbif_user), password (gbif_pw), and email (gbif_email) to this function OR write them to your .Renviron file using:

system('echo "env_gbif_user=\'your_username\'" >> ~/.Renviron'); system('echo "env_gbif_pw=\'your_password\'" >> ~/.Renviron'); system('echo "env_gbif_email=\'your_email@gmail.com\'" >> ~/.Renviron'); system("source~/.Renviron");

Author(s)

Yaniv Kovalski

Examples

1
2
3
4
## Not run: 
test <- gbif_dl('Amborella trichopoda');

## End(Not run)

rsh249/cRacle documentation built on Feb. 2, 2022, 2:01 p.m.