[R] counting entries in vector
ianfiske at gmail.com
Wed Feb 4 16:43:37 CET 2009
Armin Meier wrote:
> Hi all,
> 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)
> k <- c(5,5,5,5,2,2,4)
> => c(4,2,1)
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
View this message in context: http://www.nabble.com/counting-entries-in-vector-tp21832564p21833066.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help