R/center.R

#' center
#'
#' center returns a centered copy of a vector of values. To do this, it
#' subtracts the mean of the vector from the value.
#'
#' @param x a vector of numeric or integer values
#'
#' @return a vector of numeric values
#' @export
#'
#' @examples
#' a <- 50:100
#' center(a)
center <- function(x){
  x - mean(x)
}
garrettgman/centering documentation built on May 16, 2019, 5:38 p.m.