View source: R/determineHYSEPEvents.R
determineHYSEPEvents | R Documentation |
Function to find the longest continuous start and end dates from the Daily dataframe. Primary use case is to find input value to use in a call to HYSEP (from package DVstats). If there are gaps in the data, the function will look for the largest continous gap.
determineHYSEPEvents(HYSEPReturn, sampleDates, percent = 0.8, value = "Flow")
HYSEPReturn |
dataframe returned from hysep function (in DVstats package) |
sampleDates |
dataframe with two columns "Discharge_cubic_feet_per_second" and "maxSampleTime" |
percent |
number to use to determine event conditions. This number will be multiplied by the flow, and if that product is greater than the calculated baseflow, the sample time will be labeled an event. |
value |
character name of discharge column. |
sampleDates dataframe
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)
startEnd <- getMaxStartEnd(Daily)
Start <- startEnd$Start
End <- startEnd$End
naFreeDaily <- Daily[!is.na(Daily$Flow),]
INFO <- dataRetrieval::readNWISsite(site)
DA_mi <- INFO$drain_area_va
HYSEPReturn <- exampleHYSEP
sampleDates <- determineHYSEPEvents(HYSEPReturn, sampleDates,0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.