View source: R/quest_functions.R
center | R Documentation |
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.
center(x, center = TRUE, scale = FALSE)
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. |
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.
numeric vector of x
centered and/or standardized with the same
names as x
.
centers
center_by
centers_by
scale.default
center(x = mtcars$"disp")
center(x = mtcars$"disp", scale = TRUE)
center(x = mtcars$"disp", center = FALSE, scale = TRUE)
center(x = setNames(mtcars$"disp", nm = row.names(mtcars)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.