skala adalah fungsi umum yang metode defaultnya memusatkan dan/atau menskalakan kolom matriks numerik.
scale(x, center = TRUE, scale = TRUE)
| Parameter | Deskripsi |
|---|---|
x |
a numeric matrix(like object). |
center |
either a logical value or numeric-alike vector of length equal to the number of columns of x, where ‘numeric-alike’ means that as.numeric(.) will be applied successfully if is.numeric(.) is not true. |
scale |
either a logical value or a numeric-alike vector of length equal to the number of columns of x. |
# NOT RUN {
require(stats)
x <- matrix(1:10, ncol = 2)
(centered.x <- scale(x, scale = FALSE))
cov(centered.scaled.x <- scale(x)) # all 1
# }