get_UVflow: get_UVflow. Joins UV flow data from NWISweb to SED data from...

Description Usage Arguments Details Value See Also Examples

View source: R/get_UVflow.R

Description

Joins UV flow data from NWISweb to SED data from local NWIS database. Note this function can take several minutes to run.

Usage

1
get_UVflow(x, max.diff = "1 hours")

Arguments

x

A dataframe output from get_localNWIS

max.diff

the maximum allowable difference in time for a match. See Details. Default is "1 hour" (ie. look for a paired UV 1 hour before and 1 hour after a SED sample timestamp)

Details

This function utilizes the dataRetrieval::readSWISuv to pull Approved unit value discharge values from NWISweb and join them with SED records from the local NWIS data pull based on sampling time and unit value time.

Options utlizing the UV flow are contained in the check_Q and find_boxcoef functions.

NOTE: the dataRetrieval::readWISuv utilizes all sites and the maximum date range in dataframe x from get_localNWIS. Large numbers of sites or long date ranges can take several minutes to complete (ex. 4 sites and 2 WY completed in 2.5 minutes)

The format for max.diff should be a numeric value followed by a description of the time span. The time span must be one of "secs", "mins", "hours", "days", or "weeks" for seconds, minutes, hours, days, or weeks, respectively.

The merge of data by time borrows code from smwr::Base, but the package is not a dependency.

Value

A dataframe containing all data originally in dataframe x, with available Approved Unit Value discharge appended from NWISweb.

See Also

get_localNWIS, readNWISuv

Examples

1
2
3
4
5
6
## Not run: 
data("exampleData",package="sedReview")
x <- exampleData
mergeUV <- get_UVflow(x, max.diff = "1 hours")

## End(Not run)

USGS-R/sedReview documentation built on Aug. 24, 2020, 9 p.m.