data %>% purrr:map(levels) #Or to first factorize everything: data %>% dplyr::mutate_all(as.factor) %>% purrr:map(levels) # or data %>% summarise_each(funs(list(levels(.)))) # how to get the lengths: data %>% map(levels) %>% map(length)