View source: R/getMaxStartEnd.R
getMaxStartEnd | 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.
getMaxStartEnd(localDaily, value = "Flow", date = "Date")
localDaily |
dataframe returned from dataRetrieval |
value |
character name of discharge column |
date |
character name of date column |
named list with Start and End values
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)
startEnd <- getMaxStartEnd(Daily)
Start <- startEnd$Start
End <- startEnd$End
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.