powered by
Performs Z-score tranformation for numerical variables.
zscore(x, col = "auto", mean = NULL, sd = NULL, na.rm = FALSE)
transformed version of x.
x
a numerical vector, matrix or data.frame.
vector
matrix
data.frame
a character vector of column names or indices. If "auto", all numeric columns will be transformed. If "all", all columns will be transformed.
"auto"
"all"
a numerical value or vector indicating the mean to use for Z-score calculation; if NULL, the default is the mean of x.
mean
a numerical value or vector indicating the standard deviation(s) to use for Z-score calculation; if NULL, the default is the standard deviation of x.
a logical value indicating whether NA values in x should be stripped before the computation proceeds.
Reza Mohammadi a.mohammadi@uva.nl and Kevin Burke kevin.burke@ul.ie
scaler, minmax
scaler
minmax
x = c(2.3, -1.4, 0, 3.45) zscore(x) zscore(x, mean = 1, sd = 2)
Run the code above in your browser using DataLab