Transform columns in a data frame
facToChar.Rd
Function transforms all data frame columns of a specific class into another class.
Examples
data(mtcars)
### original classes
sapply(mtcars, class)
#> mpg cyl disp hp drat wt qsec vs
#> "numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
#> am gear carb
#> "numeric" "numeric" "numeric"
mtcars1 <- facToChar(mtcars, from = "numeric", to = "character")
sapply(mtcars1, class)
#> mpg cyl disp hp drat wt
#> "character" "character" "character" "character" "character" "character"
#> qsec vs am gear carb
#> "character" "character" "character" "character" "character"