powered by
uniq -c
Like uniq -c in shell to count a vector
count2(df)
two columns: first is type, second is number
count2(data.frame(group = c("A", "A", "B", "C", "C", "A"), value = c(2, 2, 2, 1, 3, 1)))
Run the code above in your browser using DataLab