| equilibrate {fastmatrix} | R Documentation |
scale is generic function whose default method centers and/or
scales the columns of a numeric matrix.
equilibrate(x, scale = TRUE)
x |
a numeric matrix. |
scale |
a logical value, the columns of |
For scale = TRUE, the equilibrated (each column scaled to norm one) matrix.
The scalings and an approximation of the reciprocal condition number, are returned
as attributes "scales" and "condition".
x <- matrix(c(1, 1, 1,
1, 2, 1,
1, 3, 1,
1, 1,-1,
1, 2,-1,
1, 3,-1), ncol = 3, byrow = TRUE)
x <- equilibrate(x)
apply(x, 2, function(x) sum(x^2)) # all 1