Description Usage Arguments Details Value Author(s) See Also Examples
Takes in data and colNames, and returns the data with all variables mentioned in colNames converted to factor
1 |
data |
a data.frame or data.table |
colNames |
a character vector of variable names to be converted to factor |
We often face the task of converting a bunch of variables to factor. This
function is particularly useful in such a situation. Just specify the data
and variable names and all of them will be converted to factor.
It works for both 'data.frame' and 'data.table', and the output is data of the same class as that of input.
data
of same class as input with specified variables converted to factor
Akash Jain
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.