R/cv.R

Defines functions cv

Documented in cv

#' Coefficient of variation
#'
#' @export
#' @param x numeric vector.
#' @return \code{sd(x) / mean(x)}
#'
cv <- function(x) {
  stopifnot(is.numeric(x))
  sd(x) / mean(x)
}
jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.