center | R Documentation |
This function centers a variable around the mean. To create z-scores, specify 'standardize=TRUE' A new column will be created with the centered values. There is also the option to center within context.
center( x, variables = c(colnames(x)), standardize = FALSE, drop = FALSE, suffix = NULL )
x |
dataframe |
variables |
c() of columns to standardize |
standardize |
Logical. Do you want to calculate zscores? (Default = FALSE) |
drop |
Drop original non-centered variables |
suffix |
Suffix to add at the end of the column names. Default = NULL |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.