R/utils.R

Defines functions mean

Documented in mean

#' Custom average of a vector.
#'
#' @description Works like the default 'mean' function but rounds the result
#'   to three digits.
#' @param vec A list of numerics values
#' @return mean of vector rounded up to 3 digits
mean <- function(vec) {
  # assert(
  #   check_class(vec, "numeric"),
  #   check_vector(vec),
  #   combine="and"
  # )

  round(base::mean(vec), 3)
}
redichh/checkHeight documentation built on May 29, 2019, 8:06 a.m.