R/ma2.R

Defines functions ma2

Documented in ma2

#' Function to return the MA2 hydrologic indicator statistic for a given data frame
#' 
#' This function accepts a data frame that contains a column named "discharge" and 
#' calculates the median of the daily flow values for the entire record (cubic feet per second)
#' 
#' @param x data frame containing a "discharge" column containing daily flow values
#' @return ma2 numeric value of the median daily flow for the given data frame
#' @export
#' @examples
#' qfiletempf<-sampleData
#' ma2(qfiletempf)
ma2 <- function(x) {
  ma2 <- median(x$discharge,na.rm=TRUE)
  return(ma2)
}
jlthomps/EflowStats documentation built on May 19, 2019, 12:48 p.m.