powered by
utils::type.convert()
Turns factors into characters and numerics where possible.
mutate_all_types(dat)
data.frame with no factors
data.frame to convert
Kelly Sovacool, sovacool@umich.edu
if (FALSE) { dat <- data.frame( c1 = as.factor(c("a", "b", "c")), c2 = as.factor(1:3) ) class(dat$c1) class(dat$c2) dat <- mutate_all_types(dat) class(dat$c1) class(dat$c2) }
Run the code above in your browser using DataLab