This function allows the user to select United States Geologic Survey (USGS) stations and get back daily flow values based on station selected. It uses the USGS Water Services to get the values as well as the USGS Sites.
get_usgs_dv_interactively(
ns = "usgsdv-ui",
viewer = shiny::paneViewer(),
title = "Get USGS Daily Flow Values",
...
)
A data.frame that contains flow values based on the station(s) selected during shiny session.
string
name for the Shiny namespace
to use. The ns
is unlikely to require a change.
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.
string
to customize the title of the UI window. The default
is "Get USGS Instantaneous Flow Values".
other arguments to leafletOutput()
in module.
Steps
Select the sites you want to retrieve.
When finished, press 'done' and sites daily flow values will be saved to a data.frame in local environment.
if(interactive()){
dv_usgs <- get_usgs_dv_interactively()
}
Run the code above in your browser using DataLab