R/drought_of_record.R

Defines functions drought_of_record

Documented in drought_of_record

#' Drought of Record Metric Function
#' @description Calculates when the Drought of Record occurs in dataframe - must be trimmed to water year
#' @param data a dataframe containing hydrologic information
#' @return The year when the Drought of Record occurs within dataframe
#' @import zoo 
#' @export drought_of_record
drought_of_record <- function(data) {
  flows_model1 <- zoo(data$flow, order.by = data$date)
  DoR <- fn_iha_DOR_Year(flows_model1)
  return(DoR)
}
HARPgroup/cbp6 documentation built on Nov. 8, 2022, 1:22 a.m.