with str(data) I get the headof the levels (1-2 values)
str(data)
head
fac1: Factor w/ 2 levels ... : fac2: Factor w/ 5 levels ... : fac3: Facto
Alternate option to get length of levels in a 'data'.frame:
data_levels_length <- sapply(seq(1, ncol(data)), function(x){ length(levels(data[,x])) })