Skip to content
Prev 169247 / 398506 Next

counting entries in vector

try this:

k <- c("bb", "bb", "bb", "aa", "cc", "cc")

f <- factor(k, levels = unique(k))
as.vector(table(f))

you can put it in one line but it's less readable. I hope it helps.

Best,
Dimitris
axionator wrote: