standardize_continuous_in_place: Standardize Continuous Columns In Place
Description
Standardizes selected numeric columns of a data.table in place using
a z-score transformation. The function modifies DT by reference
and stores the means and standard deviations used in an attribute
called "standardization".
Usage
standardize_continuous_in_place(DT, cols, center = TRUE, scale = TRUE)
Value
The modified data.table
DT (invisibly), with an
attribute "standardization" containing the means, standard
deviations, and names of the standardized columns.
Arguments
DT
A data.table. It is modified by reference.
cols
Character vector of column names to standardize. Columns
that are not present in DT or are not numeric are silently skipped.
center
Logical; whether to subtract the column mean.
scale
Logical; whether to divide by the column standard deviation.