View source: R/lazyFactorCoding.R
lazyFactorCoding | R Documentation |
This function eases the process of generating factor variables with relevant labels. All variables in a data.frame with less than a user set number of levels result in a line which suggests levels and labels. The result can then be modified for use.
lazyFactorCoding(data, max.levels = 10)
data |
Data frame in which to search for categorical variables. |
max.levels |
Treat non-factor variables only if the number of unique values less than max.levels. Defaults to 10. |
The code needs to be copy-and-pasted from the R-output buffer into the R-code buffer. This can be customized for the really efficiently working people e.g. in emacs.
R-code one line for each variable.
Thomas Alexander Gerds
data(Diabetes) lazyFactorCoding(Diabetes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.