standardize | R Documentation |
Function computes the z-scores for numeric columns of a dataframe.
Scores are computed by dividing the raw differences from the the mean by a multiple of the standard deviation.
standardize(df = NULL, cols = NULL, mul = 1, do_na = TRUE)
df |
A data frame with numeric columns to be standardized |
cols |
A character vector of column names from |
mul |
An integer (typically 1 or 2) that multiplies the standard deviation as the divisor for the z-score. |
do_na |
A logical which if |
Returns a data.table with the numeric columns standardized into z-scores.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.