uzscale | R Documentation |
Universal z-scale function Standardize dataframe to z scores, safe for non-numeric variables. ELo 201904 GWU DATS
uzscale(df, append = 0, excl = NULL)
df |
The dataframe. |
append |
T/F or 0/1. Option to append scaled columns or replace original columns in the dataframe. |
excl |
A list c(a,b,"d","ef") of excluded columns, either by their indexes and/or names. |
The transformed dataframe, appended or replaced with standardized scores. Non-numeric columns will not be appended, or if "replace option" is chosen, the columns will be untouched.
tmp = uzscale( ISLR::Hitters )
tmp = uzscale( ISLR::Hitters, 1 )
tmp = uzscale( ISLR::Hitters, TRUE, c(19,"NewLeague") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.