You can do this (imagine your data.frame has a name df):
sapply(df, class)
Indeed, output with a time variable is less nice:
library(lubridate)
df <- data.frame(V1 = character(10),
V2 = numeric(10),
V3 = ymd(paste("2014-05", 21:30, sep="-")))
sapply(df, class)
#
#
#
#
#
#
#
#
, , , :
names(df)[sapply(df, class) == "factor"]
##[1] "V1"
# for time variable it less obvious indeed...
names(df)[grepl("POSIXct", sapply(df, class))]
##[1] "V3"