Re: [R] Indexing vector with repeated values

2006-05-26 Thread Uwe Ligges
Andris Jankevics wrote: > Hi all, > I have a vector which contains many repeated values. > > >>Z <- c(1,2,3,4,5,1,2,3,4,5,1,2,3,5,5,2,3,4,5) > > > I need to know how many times each number in this vecetor is repeated. > I can use a command like this: > > >>table (cut(Z,seq(1,5,1))) Why not

[R] Indexing vector with repeated values

2006-05-26 Thread Andris Jankevics
Hi all, I have a vector which contains many repeated values. >Z <- c(1,2,3,4,5,1,2,3,4,5,1,2,3,5,5,2,3,4,5) I need to know how many times each number in this vecetor is repeated. I can use a command like this: > table (cut(Z,seq(1,5,1))) (1,2] (2,3] (3,4] (4,5] 4 4 3 5 But ho