findSampleQ | R Documentation |
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.
findSampleQ(site, sampleDates, localDaily, value = "Flow")
site |
string USGS identification number |
sampleDates |
dataframe with two columns "ActivityStartDateGiven" and "ActivityEndDateGiven" |
localDaily |
dataframe returned from dataRetrieval |
value |
character name of discharge column |
sampleDates
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.