R/PrecDailyToYearly.R

Defines functions Prec.DailyToYearly

Documented in Prec.DailyToYearly

#' Internal Helper Prec.DailyToYearly
#' ...
#'
#' @param ...
#'
#' @return Returns the desired output
#'
#'
#' @import data.table
#' @export


Prec.DailyToYearly <- function(dat) {

  setDT(dat)
  setkey(dat, YR)

  dat[, PREC := RFAL + SFAL]
  dat[, BSTN := RFAL + SFAL - RINT - SINT]

  dat_yr <- dat[,list(
    PREC = sum(PREC),
    BSTN = sum(BSTN)),
  by = YR]
  return(dat_yr)

}
rhabel/modLWFB90 documentation built on Nov. 21, 2024, 3:28 a.m.