R/mean_by_WY.R

Defines functions mean_by_WY

Documented in mean_by_WY

#' Creates a WY mean df from daily df
#'
#'This function takes in the merged daily dataframe
#'containing all the variables from channel,  totalwatsed and
#'event by event dataframes and returns WY mean df
#'
#' @param dailydf A merged daily dataframes containing all the simulated varibles
#' @return A dataframe containing WY mean summary
#'
#' @export

mean_by_WY <- function(dailydf){
  WY_mean_df <- daily_df %>%
    dplyr::select(-DOY_wshed, -Y_wshed, -Date, -Year_chan, -Day_chan,
           -Chan_ID_chan, -Elmt_ID_chan) %>%
    dplyr::group_by(WY) %>%
    dplyr::summarise_all(.funs = mean) %>% dplyr::ungroup()
  return(as.data.frame(WY_mean_df))
}
devalc/WEPPRecipes documentation built on Jan. 3, 2022, 2:24 a.m.