powered by
fscale(x)
NA
If there is just 1 non-missing value in a column, it is left as is.
This function uses a one-pass algorithm to calculate the mean and SD, which is fast but can show a bit of round-off error.
scale
x <- matrix(1:10, ncol=2) y <- fscale(x)
Run the code above in your browser using DataLab