rvertnet (version 0.6.2)

searchbyterm: Search by term

Description

Flexible search for records using keywords/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, query = NULL, messages = TRUE, only_dwc = TRUE, ...)

Arguments

specificepithet

(character) Taxonomic specific epithet, e.g. (sapiens in Homo sapiens)

genus

(character) Taxonomic genus

family

(character) Taxonomic family

order

(character) Taxonomic order

class

(character) Taxonomic class

limit

(numeric) Limit on the number of records returned. If >1000 results, we use a cursor internally, but you should still get up to the results you asked for. See also 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)

query

(character) full text search term(s). not tied to any specific field. This does the same thing as using vertsearch, where this searches for any mention of these terms

messages

Print progress and information messages. Default: TRUE

only_dwc

(logical) whether or not to return only Darwin Core term fields. Default: TRUE

...

Curl arguments passed on to HttpClient

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).

References

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

Examples

Run this code
# NOT RUN {
# Find multiple species
(out <- searchbyterm(genus = "ochotona", 
  specificepithet = "(princeps OR collaris)", limit=10))

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

# Specifying records by event date (use quotes)
out <- searchbyterm(class = "aves", state = "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(crul)
out <- searchbyterm(class = "aves", limit = 10, config=verbose())
# out <- searchbyterm(class = "aves", limit = 500, config=timeout(1))

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

# full text search - note the URL message
searchbyterm(query = "Mustela nigripes", limit = 50)
searchbyterm(query = "bear", limit = 50)
# }

Run the code above in your browser using DataCamp Workspace