R/utils.R

Defines functions center

Documented in center

#' Center a vector
#'
#' \code{center} returns a numeric vector with centered values.
#'
#' @param x Numeric vector.
center <- function(x) {
    
    centered <- as.vector(scale(x = x, center = TRUE, scale = FALSE))
    
    return(centered)
}

Try the medmod package in your browser

Any scripts or data that you put into this service are public.

medmod documentation built on May 1, 2019, 10:25 p.m.