DTconvert2factor: Bulk type conversion of columns to factors

Description Usage Arguments Value Author(s) Examples

View source: R/conversion.R

Description

Converts multiple columns of same type to factor Possible enhancements : Specify the columns to be converted

Usage

1
DTconvert2factor(x, typeToConvert = "chr")

Arguments

x

data.frame (or data.table)

typeToConvert

type of the columns to be converted

Value

data.table

Author(s)

Amit Agni

Examples

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")

amit-agni/cutlery documentation built on Dec. 31, 2019, 2:09 p.m.