readWQPbySite: Read WQP data by selecting sites in an interactive map

View source: R/readWQPbySite.r

readWQPbySiteR Documentation

Read WQP data by selecting sites in an interactive map

Description

This function allows the user to read WQP data by selecting desired sites in an interactive map and specifiying desired types of data and output. When map is launched, either click (mode="click") or draw polygons (mode="draw") around desired sites, then click "Done" button at bottom right of map. If edit==TRUE, an edit dialog will open in R console. Update "keep" column to anything other than "Y" to reject selected sites, then close dialog to proceed.

Usage

readWQPbySite(
  sites,
  map,
  mode = "click",
  types = c("sites", "narrowresult", "activity"),
  merge = T,
  edit = T,
  sitetypes = c("Canal Drainage", "Canal Irrigation", "Canal Transport", "Lake",
    "Lake, Reservoir, Impoundment", "Reservoir", "River/Stream",
    "River/Stream Intermittent", "River/Stream Perennial", "Seep", "Spring", "Stream",
    "Stream: Canal", "Stream: Ditch", "Wetland", "Wetland Undifferentiated"),
  ...
)

Arguments

sites

Optional. A sites object containing lat/long columns named "LatitudeMeasure" & "LongitudeMeasure". If no sites object is provided, a Utah state-wide query of WQP will be generated for you.

map

Optional. A map object to use as a background for site selection. If no map object is provided, a basic map will be generated for you.

mode

Mode for map selection. One of "click" or "draw". Click allows site selection by clicking on individual sites. Draw allows site selection by polygons.

types

Vector of data types to read from WQP for selected sites. See ?wqTools::readWQP for options.

merge

Logical. If TRUE (default), merge all selected data types to single data frame. Merges are performed as left joins in order they are provided. If FALSE, return list of individual data objects.

edit

Logical. If TRUE (default) open editor in R console to edit selected sites. To drop sites from the query, update the "keep" column to anything other than "Y", then close edit dialog.

sitetypes

Vector of site types to be included in query (only used if sites argument is not provided).

...

Other arguments to be passed to readWQP (e.g. start_date, end_date, characteristicName, etc.). See ?wqTools::readWQP for more info. This is passed to both the sites query (if sites are not provided) and the results queries.

Examples

wqp_data=readWQPbySite(start_date="01/01/2016", end_date="12/31/2018")

utah-dwq/udwqTools documentation built on July 17, 2024, 10:21 p.m.