R/calc-constant.r

Defines functions calc_constant

Documented in calc_constant

#' constant needed for slow coding
#' 
#' sum of vector 1:m, when m (month) is not zero
#' 
#' @param m month integer
calc_constant <- function(m) {
  if (!is.numeric(m)) {
    stop("'m' (month) must be an numeric representation.")
  }
  
  v <- 0
  if (m != 0) {
    v <- sum(1:m)
  }
  return(v)
}
aescherling/optic-core documentation built on June 15, 2022, 4:56 a.m.