| standardize_continuous | R Documentation |
Standardizes selected numeric columns using z-score or robust (median/MAD) methods. Binary columns (0/1) are left unchanged.
standardize_continuous(
DT,
cols,
method = c("zscore", "robust"),
center = TRUE,
scale = TRUE
)
DT |
A data.table or data.frame. |
cols |
Character vector of column names to standardize. |
method |
Character; either "zscore" or "robust". |
center |
Logical; whether to center the data. |
scale |
Logical; whether to scale the data. |
A list with components:
DT |
The standardized data.table. |
scalers |
A list of scaling parameters for each column. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.