zscore {DMTL} | R Documentation |
This function standardized each column of a dataframe or matrix (-alike) to
have mean = 0
and sd = 1
.
zscore(X)
X |
Dataframe or matrix (-alike) containing data. |
The standardized dataframe.
X <- matrix(rnorm(100, 0.2, 0.3), nrow = 20)
X_std <- zscore(X)
print(apply(X_std, 2, mean))
print(apply(X_std, 2, sd))