Learn R Programming

rvertnet (version 0.3.0)

searchbyterm: Search for records using keywords/terms to control how your query is interpreted.

Description

Returns only those records in which the targeted input is found in association with the specified search terms.

Usage

searchbyterm(specificepithet = NULL, genus = NULL, family = NULL,
  order = NULL, class = NULL, limit = 1000, compact = TRUE,
  year = NULL, date = NULL, mappable = NULL, error = NULL,
  continent = NULL, cntry = NULL, stateprovince = NULL, county = NULL,
  island = NULL, igroup = NULL, inst = NULL, id = NULL,
  catalognumber = NULL, collector = NULL, type = NULL,
  hastypestatus = NULL, media = NULL, rank = NULL, tissue = NULL,
  resource = NULL, verbose = TRUE, ...)

Arguments

specificepithet
Taxonomic specific epithet, e.g. (sapiens in Homo sapiens) (character)
genus
Taxonomic genus (character)
family
Taxonomic family (character)
order
Taxonomic order (character)
class
Taxonomic class (character)
limit
(numeric) Limit on the number of records returned. Up to 1000. We'll incorporate paging later for higher limits. See bigsearch to get larger result sets in a text file via email.
compact
Return a compact data frame (logical)
year
Year (numeric) or range of years designated by comparison operators "<", "="">", "<=" or="" "="">=". You can pass in more than one of these queries, in a vector. See example below. (character)
date
Event date associated with this occurrence record; yyyy-mm-dd or the range yyyy-mm-dd/yyyy-mm-dd (character)
mappable
Record includes valid coordinates in decimal latitude and decimal longitude (logical)
error
Coordinate uncertainty in meters (numeric) or range of uncertainty values designated by comparison operators "<", "="">", "<=" or="" "="">=" (character)
continent
Continent to search for occurrence (character)
cntry
Country to search for occurrence (character)
stateprovince
State or province to search for occurrence (character)
county
County to search for occurrence (character)
island
Island to search for occurrence (character)
igroup
Island group to search for occurrence (character)
inst
Code name for the provider/institution of record (character)
id
Provider's unique identifier for this occurrence record (character)
catalognumber
Provider's catalog number or other ID for this record (character)
collector
Collector name (character)
type
Type of record; "specimen" or "observation" (character)
hastypestatus
Specimen associated with this record is identified as a holotype, paratype, neotype, etc. (character)
media
Record also references associated media, such as a film or video (logical)
rank
TBD (numeric)
tissue
Record is likely to reference tissues (logical)
resource
Identifier for the resource/dataset from which the record was indexed (character)
verbose
Print progress and information messages. Default: TRUE
...
Curl arguments passed on to GET

Value

  • A data frame of search results

Details

searchbyterm builds a query from input parameters based on Darwin Core (dwc) terms (for the full list of terms, see https://code.google.com/p/darwincore/wiki/DarwinCoreTerms). The query string is appended to the base URL for VertNet search requests. View the query string for specification of dwc terms used in the search.

References

https://github.com/VertNet/webapp/wiki/The-API-search-function

Examples

Run this code
# Limit the number of records returned to <1000; use bigsearch() for >1000 records
(out <- searchbyterm(class = "aves", st = "california", lim = 10))

# Find multiple species
(out <- searchbyterm(gen = "ochotona", specificepithet = "(princeps OR collaris)", limit=10))

# Specifying a single year (no quotes) or range of years (use quotes)
(out <- searchbyterm(class = "aves", st = "california", y = 1976, limit=10))
(out <- searchbyterm(class = "aves", st = "california", y = ">=1976", limit=10))

# Specifying a range (in meters) for uncertainty in spatial location (use quotes)
out <- searchbyterm(class = "aves", st = "nevada", error = "<25")
out <- searchbyterm(class = "aves", st = "california", y = 1976, error = "<=1000")

# Specifying records by event date (use quotes)
out <- searchbyterm(class = "aves", st = "california", date = "2009-03-25")
# ...but specifying a date range may not work
out <- searchbyterm(specificepithet = "nigripes", date = "1935-09-01/1935-09-30")

# Pass in curl options for curl debugging
library("httr")
out <- searchbyterm(class = "aves", limit = 10, config=verbose())
# out <- searchbyterm(class = "aves", limit = 500, config=timeout(1))

# Request more than 1000 records
out <- searchbyterm(genus = "Ochotona", limit = 1500)
out$meta
out$data
NROW(out$data)

# Use more than one year query
searchbyterm(class = "aves", year = c(">=1976", "<=1986"))

Run the code above in your browser using DataLab