setNames(as.data.frame(table(df1$asa)), c("asa", "n")) # asa n #1 aa 3 #2 bb 2 #3 cc 1 #4 dd 1
df %>% count(column_to_check)