zscore {DMTL} | R Documentation |
Standardize matrix per column
Description
This function standardized each column of a dataframe or matrix (-alike) to
have mean = 0
and sd = 1
.
Usage
zscore(X)
Arguments
X |
Dataframe or matrix (-alike) containing data. |
Value
The standardized dataframe.
Examples
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))
[Package DMTL version 0.1.2 Index]