gbif: Data from GBIF

View source: R/gbif.R

gbifR Documentation

Data from GBIF

Description

This function downloads species occurence records from the Global Biodiversity Information Facility (GBIF) data portal. You can download either a single species (if you append a '*' to the species name) or a subspecies of comparable level. You can download the data for an entire genus by using species='*'. Before using this function, please first check the GBIF data use agreement and see the note below about how to cite these data.

Usage

gbif(genus, species="", ext=NULL, args=NULL, geo=TRUE, sp=FALSE, 
   removeZeros=FALSE, download=TRUE, ntries=5, nrecs=300, start=1, end=Inf)

Arguments

genus

character. genus name

species

character. species name. Use '*' to download the entire genus. Append '*' to the species name to get all naming variants (e.g. with and witout species author name) and sub-taxa

ext

Extent object to limit the geographic extent of the records. An extent can be created using functions like drawExtent and extent

args

character. Additional arguments to refine the query. See query parameters in https://www.gbif.org/developer/occurrence for more details

geo

logical. If TRUE, only records that have a georeference (longitude and latitude values) will be downloaded

sp

logical. If TRUE, geo will be set to TRUE and a SpatialPointsDataFrame will be returned

removeZeros

logical. If TRUE, all records that have a latitude OR longitude of zero will be removed if geo==TRUE, or set to NA if geo==FALSE. If FALSE, only records that have a latitude AND longitude that are zero will be removed or set to NA

download

logical. If TRUE, records will be downloaded, else only the number of records will be shown

ntries

integer. How many times should the function attempt to download the data, if an invalid response is returned (perhaps because the GBIF server is very busy)

nrecs

integer. How many records to download in a single request (max is 300)?

start

integer. Record number from which to start requesting data

end

integer. Last record to request

Value

data frame

Note

Under the terms of the GBIF data user agreement, users who download data agree to cite a DOI. Citation rewards data-publishing institutions and individuals and provides support for sharing open data [1][2]. You can get a DOI for the data you downloaded by creating a "derived" dataset. For this to work, you need to keep the "datasetKey" variable in your dataset.

Author(s)

Robert J. Hijmans

References

https://www.gbif.org/occurrence

Examples

## Not run: 

gbif('solanum', download=FALSE)
gbif('solanum', 'acaule', download=FALSE)

gbif('Batrachoseps', '' , down=FALSE)
gbif('Batrachoseps', 'luciae', down=FALSE)
g <- gbif('Batrachoseps', 'luciae', geo=TRUE)
plot(g$lon, g$lat)

gs <- gbif('Batrachoseps', 'luciae', sp=TRUE)
plot(gs)

## End(Not run)

dismo documentation built on May 31, 2023, 6:15 p.m.