R/dl15.R

Defines functions dl15

Documented in dl15

#' Function to return the DL15 hydrologic indicator statistic for a given data frame
#' 
#' This function accepts a data frame that contains a column named "discharge" and calculates 
#' DL15; Low exceedence flows. Compute the 90-percent exceedence value for the entire flow record. DL15 is the 
#' exceedence value divided by the median for the entire record (dimensionless-spatial).
#' 
#' @param qfiletempf data frame containing a "discharge" column containing daily flow values
#' @return dl15 numeric containing DL15 for the given data frame
#' @export
#' @examples
#' qfiletempf<-sampleData
#' dl15(qfiletempf)
dl15 <- function(qfiletempf) {
  isolateq <- qfiletempf$discharge
  sortq <- sort(isolateq)
  hfcrit <- quantile(sortq,.1,type=6)
  medianq <- median(qfiletempf$discharge)
  dl15 <- hfcrit/medianq
  return(dl15)
}
jlthomps/EflowStats documentation built on May 19, 2019, 12:48 p.m.