R/normalize.R

Defines functions normalize

Documented in normalize

#' Normalize to have mean 1 
#' 
#' @export 
#' @param x vector to normalize to have mean 1. 
#' @return \code{x / mean(x)}
#' 
normalize <- function(x) {
  # normalize to have mean 1
  stopifnot(is.numeric(x))
  x / mean(x)
}
jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.