center_scale {tidycomm} | R Documentation |
Center numeric, continuous variables
Description
This function centers the specified numeric columns or all numeric columns if none are specified. A centered scale has a mean of 0.0.
Usage
center_scale(data, ..., name = NULL, overwrite = FALSE)
Arguments
data |
|
... |
Numeric variables to be centered. If none are provided, all numeric columns will be centered. |
name |
Optional name for the new centered variable when a single
variable is provided. By default, the name will be the original variable
name suffixed with |
overwrite |
Logical. If |
Value
A tdcmm model with the centered variable(s).
See Also
Other scaling:
categorize_scale()
,
dummify_scale()
,
minmax_scale()
,
recode_cat_scale()
,
reverse_scale()
,
setna_scale()
,
z_scale()
Examples
WoJ %>% dplyr::select(autonomy_emphasis) %>% center_scale(autonomy_emphasis)
WoJ %>% center_scale(autonomy_emphasis, name = "my_centered_variable")
WoJ %>% center_scale(overwrite = TRUE)
WoJ %>%
center_scale(autonomy_emphasis) %>%
tab_frequencies(autonomy_emphasis, autonomy_emphasis_centered)
[Package tidycomm version 0.4.1 Index]