Message-ID: <loom.20090204T153237-455@post.gmane.org>
Date: 2009-02-04T15:33:17Z
From: Ben Bolker
Subject: counting entries in vector
axionator <axionator <at> gmail.com> writes:
> I've a vector with entries, which are all of the same type, e.g. string:
> k <- c("bb", "bb", "bb", "aa", "cc", "cc")
> and want to create a second vector containing the number of each entry
> in k in the same order as in k, i.e.
> c(3, 1, 2)
table(k)
Ben Bolker