mpg |>
dplyr::mutate_if(is.character, as.factor) |>
dplyr::mutate_if(is.logical, as.factor) |>
dplyr::mutate_if(is.integer, as.numeric)
I have the above code. Is there a more simple way to write this code without calling mutate_if
three times?
dplyr::case_when
? - Eric