gbif_records.Rd
This function is used to download occurrence records from GBIF within a year range for given taxonomic group(s) for a given area. The function requires the packages 'rgbif', 'rgdal', and 'rgeos'
gbif_records(
groups,
rank,
bounds,
years,
yr_from = as.numeric(substr(Sys.Date(), 1, 4)),
limit = 50000,
genus_level = FALSE
)
A character or vector of taxonomic group names of the same taxonomic rank
A character equal to the taxonomic level of the group(s) (e.g. 'class')
A shapefile of a simplified polygon that bounds the study area (e.g. outline of the Caribbean bioregion)
A number equal to the number of years before the present year (default) or
before yr_from
for which you want occurrences collected. See Details for more information.
A number equal to the year of the most current records you want to download. The
default is the current year as determined by Sys.Date()
. See Details for more information.
A numerical value equal to the maximum number of records wanted. See Details for more information.
Logical. If TRUE
then the records that were only identified to
the genus level are returned. If FALSE
, then these records are omitted
A data frame with the occurrence observations of species within the taxonomic group(s).
The function only returns the columns: "order", "family", "genus", "species", "eventDate", "year",
"decimalLatitude", "decimalLongitude", "basisOfRecord", "occurrenceID", and "references" from the
occ_search()
function of the 'rgbif' package
In order to download records for a certain year range, you have to specify both years
and yr_from
. The years
argument tells the function to download all records from a
specified number of years prior to yr_from
. For example, if you want records from 2016 through
2018 then you would set years = 2
and yr_from = 2018
. However, the default for yr_from
is the year of the computer system (i.e. for most the current year). Therefore, if you only want records
from two years prior through the current year, you only need to set years = 2
and nothing for years
.
The default number of records returned is 50,000, and therefore, if you want all records within a certain time
frame, you should check that the number of records returned does not equal the 50,000 If it does then you
should set limit
to a larger number. For example, if the returned data frame of records for only one
taxonomic groups has nrow(df) = limit
, which the default is 50,000, increase the limit to ensure all
of the records are downloaded for that group. However, the maximum number of records that can be downloaded
is 200,000 at a time.