center: Centering and/or Standardizing a Numeric Vector
Description
center centers and/or standardized a numeric vector. It is an
alternative to scale.default that returns a numeric vector rather than
a numeric matrix.
Usage
center(x, center = TRUE, scale = FALSE)
Value
numeric vector of x centered and/or standardized with the same
names as x.
Arguments
x
numeric vector.
center
logical vector with length 1 specifying whether grand-mean
centering should be done.
scale
logical vector with length 1 specifying whether grand-SD scaling
should be done.
Details
center first coerces x to a matrix in preparation for the call
to scale.default. If the coercion results in a non-numeric matrix
(e.g., x is a character vector or factor), then an error is returned.