I have a dataset, named diamonds. It has ten variables: carat, cut, color, clarity... So, how can I write a code to find out which variables are categorical variables. I now using class() function to find out the type of each variable, but how can I let my program print it automatically?
classVariables = sapply(diamonds, function(x) class(x))