Description Usage Arguments Value
This function centers and scales the variables provided by vars by subtracting by the mean and dividing by the starndard deviation. It will also create new columns appending with "_ns" to save the original nonscaled values.
1 | lcmem_prep(df, vars, center = TRUE, scale = TRUE)
|
df |
Dataframe object |
vars |
character vector providing the names of the columns we would like to center and scale |
center |
a boolean that specifies if vars should be centered by subtracting by the mean |
scale |
a boolean that spcifies if vars should be devided by their standard deviation |
a dataframe with vars centered and scaled and their nonscaled values stores as var_ns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.