Description Usage Arguments Value Author(s) Examples
Converts multiple columns of same type to factor Possible enhancements : Specify the columns to be converted
1 | DTconvert2factor(x, typeToConvert = "chr")
|
x |
data.frame (or data.table) |
typeToConvert |
type of the columns to be converted |
data.table
Amit Agni
1 2 3 4 5 6 | DT <- data.frame(c1=c("a","b","c")
,c11 = c("a","b","c")
,c2 = 1:3
,c3 = c(1.1,1.2,1.3)
,stringsAsFactors = F)
DT <- DTconvert2factor(DT,"int")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.