# NOT RUN {
library(data.table)
inputDT <- as.data.table(data.frame(x = seq(1, 20, 2), y = LETTERS[1:10]))
asFactorDT(inputDT, c('y'))
# }
# NOT RUN {
asCharacterDT(inputDT)
# }
# NOT RUN {
asCharacterDT(inputDT, c('x', 'y'))
# First looking at the result, followed by testing if the transformation worked!
inputDT
isCharacterDT(inputDT, c('x', 'y'))
isFactorDT(inputDT, c('x', 'y'))
# }
Run the code above in your browser using DataLab