View source: R/ms_identify_usgs_gauges.R
ms_identify_usgs_gauges | R Documentation |
Search for USGS gauges within a radius of a location specified by latitude and longitude
ms_identify_usgs_gauges(sites, lat = NULL, long = NULL, radius = 500)
sites |
Either an |
lat |
Character. If sites is not a |
long |
Character. If sites is not a |
radius |
Numeric. The radius in meters within which to search for USGS gauges; Default 500. |
This function will search for a USGS gauge within the radius supplied
for every site in the sites file. The dataRetrieval
package is used to locate USGS gauges.
If no USGS gauge is found, then the usgs_site
column will be NA for that site.
returns a data.frame
with the column usgs_site
.
Spencer Rhea
Mike Vlah, vlahm13@gmail.com
Wes Slaughter
# With lat long
sites <- tibble(site_code = c('MA_AE03', 'MI_KR01'),
Latitude = c(42.04856, 42.28575),
Longitude = c(-72.45403, -85.51467))
ms_identify_usgs_gauges(sites = sites, lat = 'Latitude', long = 'Longitude')
# With sf
site_sf <- sites %>%
sf::st_as_sf(coords = c('long', 'lat'), crs = 4326) %>%
sf::st_buffer(radius)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.