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
If your problem is specifically to output a list of all levels for a factor, then I have found a simple solution using :
unique(df$x)
For instance, for the infamous iris dataset:
unique(iris$Species)