Learn R Programming

gwavr (version 0.3.2)

get_usgs_iv_interactively: Get United States Geologic Survey (USGS) Instantaneous Flow Values Interactively

Description

This function allows the user to select United States Geologic Survey (USGS) stations and get back instantaneous flow values based on control number of days from now. It uses the USGS Water Services to get the values as well as the USGS Dashboard to get current conditions (circle markers on map).

Usage

get_usgs_iv_interactively(
  ns = "usgsiv-ui",
  viewer = shiny::paneViewer(),
  title = "Get USGS Instantaneous Flow Values",
  ...
)

Value

A data.frame that contains flow values based on the station(s) selected during shiny session.

Arguments

ns

string name for the Shiny namespace to use. The ns is unlikely to require a change.

viewer

function for the viewer. See Shiny viewer. NOTE: when using browserViewer(browser = getOption("browser")) to open the app in the default browser, the browser window will automatically close when closing the app (by pressing "done" or "cancel") in most browsers. Firefox is an exception. See Details for instructions on how to enable this behaviour in Firefox.

title

string to customize the title of the UI window. The default is "Get USGS Instantaneous Flow Values".

...

other arguments to leafletOutput() in module.

Details

Steps

  1. Select the sites you want to retrieve.

  2. Make sure you have the right days.

  3. When finished, press 'done' and sites instantaneous flow values will be saved to a data.frame in local environment.

Examples

Run this code

if(interactive()){
iv_usgs <- get_usgs_iv_interactively()
}



Run the code above in your browser using DataLab