rinat (version 0.1.4)

get_inat_obs: Download inaturalist data

Description

Primary function to retrieve observations from iNaturalist, allows users to search for data, or just filter results by a subset of what is offered by the API

Usage

get_inat_obs(query = NULL, taxon = NULL, quality = NULL, geo = NULL, year = NULL, month = NULL, day = NULL, bounds = NULL, maxresults = 100, meta = FALSE)

Arguments

query
Query string for a general search
quality
the quality grade to be used. Must be either "casual" or "research" If left blank both will be returned.
taxon
Filter by iNat taxon name. Note that this will also select observations of descendant taxa. Note that names are not unique, so if the name matches multiple taxa, no observations may be returned.
geo
flag for returning only results that are georeferenced, TRUE will exclude non-georeferenced results, but they cannot be excluded.
year
return observations only in that year (can only be one year, not a range of years)
month
return observations only by month, must be numeric, 1...12
day
return observations only on a given day of the month, 1...31
bounds
a bounding box of longitude (-180 to 180) and latitude (-90 to 90) to search within. It is a vector in the form of southern latitude, western longitude, northern latitude, and easter longitude
maxresults
the maximum number of results to return
meta
(logical) If TRUE, the output of this function is a list with metadata on the output and a data.frame of the data. If FALSE (default), just the data.frame.

Value

a dataframe of the number of observations requestsed

Examples

Run this code
## Not run: 
#   ### Make a standard query
#   get_inat_obs(query="Monarch Butterfly")
# 
#   ##Filter by a bounding box of Northern California
#   bounds <- c(38.44047,-125,40.86652,-121.837)
#   get_inat_obs(query="Mule Deer", bounds=bounds)
# 
#   ## Filter with by just taxon, allows higher order filtering,
#   ## Here we can search for just stone flies (order plecoptera)
#   get_inat_obs(taxon="Plecoptera")
# 
#   ## get metadata (the number of results found on the server)
#   out <- get_inat_obs(query="Monarch Butterfly", meta=TRUE)
#   out$meta
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace