I would like to be able to identify columns in a dataframe (eg cols am
and vs
in mtcars
) that contain integers and convert them to factors.
Important note: In the dataset, columns that do contain integers, are encoded as numeric (so is.integer
would not work)..
Is there a solution with tidyverse? Thank you!
EDIT: I found the solution in this post: check if all values in data.frame columns are integers to subset dummy variables aka are all values in a column TRUE?