queryAPI: Create query to grab data from API request

Description Usage Arguments Value See Also Examples

View source: R/get_data.R

Description

get_data is a wrapper for httr::GET that connects to Vermont Atlas of Life's API

Usage

1
2
3
4
5
6
7
8
queryAPI(
  query,
  type = "occurrences",
  fields = "all",
  quiet = FALSE,
  pageSize = NULL,
  spatialWKT = NULL
)

Arguments

query

list of query terms list('order:Odonata','etc')

type

options include "TotalObs" and 'occurrences'. TotalObs returns only the number of observations. No data. occurrence returns data associated with occurrence records. default = occurrences.

fields

defaults to 'all'. see dataFields for returnable fields

quiet

defaults to FALSE, if TRUE prints brief description to console

pageSize

defaults to NULL which returns all records

spatialWKT

well-known text for a POLYGON or MULTIPOLYGON, defaults to null

Value

data frame of results from query

See Also

dataFields for description of fields and which fields can be queried

Examples

1
2
3
4
## Not run: queryAPI(query = list("order:Odonata"),
                  type = 'occurrences',
                  fields = c('taxon_name','longitude','latitude','year'))
## End(Not run)

VtEcostudies/VTatlas documentation built on Dec. 18, 2021, 6:20 p.m.