I need to change column classes over my entire data.frame. Ideally looking for an apply
solution, but open to tidyverse
or other solutions as well.
Example data
set.seed(1)
d <- data.frame("numbers" = as.character(1:10),
"letters" = letters[1:10],
"boolean" = sample(c("T", "F"), 10, T),
stringsAsFactors = F)
I would like to make the first column (numbers
) numeric
, the second column (letters
) character
, and the third column (boolean
) logical
.