View source: R/as.nlevels_Function.R
Transform a variable of class factor to class numeric by not changing the actual values of the variable. This is different to simply applying as.numeric; for example a factor variable with levels 0 & 1, will NOT be transformed to values 1 & 2 respectively but rather it will retain the original values.
1 | as.nlevels(x)
|
x |
The vector or variable that needs to be transformed. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.