findSampleQ: Find flow for sample times

View source: R/findSampleQ.R

findSampleQR Documentation

Find flow for sample times

Description

Function to find flows values for given sample times. If instantaneous data is available, this function will retrieve that data, otherwise the Daily streamflow data will be used. If the sample times have a start and end time, the flow is the maximum flow in the range of the sample.

Usage

findSampleQ(site, sampleDates, localDaily, value = "Flow")

Arguments

site

string USGS identification number

sampleDates

dataframe with two columns "ActivityStartDateGiven" and "ActivityEndDateGiven"

localDaily

dataframe returned from dataRetrieval

value

character name of discharge column

Value

sampleDates

Examples

site <- "04085427"
sampleDates <- sampleDates
Start_extend <- as.character(as.Date(min(sampleDates$ActivityStartDateGiven, na.rm=TRUE))-60)
End_extend <- as.character(as.Date(max(sampleDates$ActivityStartDateGiven, na.rm=TRUE))+60)
Daily <- dataRetrieval::readNWISdv(site,'00060', Start_extend, End_extend)
Daily <- dataRetrieval::renameNWISColumns(Daily)
sampleDates <- findSampleQ(site, sampleDates, Daily)

USGS-R/USGSHydroTools documentation built on April 17, 2023, 8:09 p.m.