Scale data columns, skipping non-scalable columns
umx_scale
applies scale to the columns of a data.frame. By default it scales all numeric columns,
and is smart enough to skip non-scalable columns (strings, factors, etc.).
You can also select which columns to convert. This is useful when you want to avoid numeric columns which are actually factors.
note: By default, the attributes which scale adds ("scaled:center" and
"scaled:scale" removed to leave nice numeric columns. Set attr= TRUE
to preserve these.
umx_scale( df, varsToScale = NULL, coerce = FALSE, attr = FALSE, verbose = FALSE )
df |
A dataframe to scale (or a numeric vector) |
varsToScale |
(leave blank to scale all) |
coerce |
Whether to coerce non-numerics to numeric (Defaults to FALSE. |
attr |
to strip off the attributes scale creates (FALSE by default) |
verbose |
Whether to report which columns were scaled (default FALSE) |
new dataframe with scaled variables
umx_scale_wide_twin_data scale
Other Miscellaneous Stats Functions:
FishersMethod()
,
SE_from_p()
,
geometric_mean()
,
harmonic_mean()
,
oddsratio()
,
reliability()
,
umxCov2cor()
,
umxHetCor()
,
umxWeightedAIC()
,
umx_apply()
,
umx_cor()
,
umx_means()
,
umx_r_test()
,
umx_round()
,
umx_var()
,
umx
data(twinData) df = umx_scale(twinData, varsToScale = c("wt1", "wt2")) df = umx_scale(twinData, attr= TRUE) plot(wt1 ~ wt2, data = df)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.