scaling variables using standardization or normalization
var_scale(dt, var_skip = NULL, type = "standard", ...)
a data frame or vector
Name of variables that will skip for scaling Defaults to NULL.
type of scaling method, including standard or minmax.
Additional parameters.
data("germancredit")
# standardization
dts1 = var_scale(germancredit, type = 'standard')
# normalization/minmax
dts2 = var_scale(germancredit, type = 'minmax')
dts2 = var_scale(germancredit, type = 'minmax', new_range = c(-1, 1))
Run the code above in your browser using DataLab