Re: [R] Repeated values

2009-03-11 Thread Chuck Cleland
On 3/11/2009 5:08 AM, Tammy Ma wrote: > Hi,All. > > How to make a program to delete repeated value? > > a example > >> c > [1] 4 3 0 3 4 1 0 1 4 4 3 4 3 4 > > I want to get : 4 3 0 3 4 1 0 1 4 3 4 3 4 > > two 4 is being represented by one 4. x <- c(4, 3, 0, 3, 4, 1, 0, 1, 4, 4, 3, 4, 3, 4)

Re: [R] Repeated values

2009-03-11 Thread Dimitris Rizopoulos
try this: x <- c(4, 3, 0, 3, 4, 1, 0, 1, 4, 4, 3, 4, 3, 4) rle(x)$values I hope it helps. Best, Dimitris Tammy Ma wrote: Hi,All. How to make a program to delete repeated value? a example c [1] 4 3 0 3 4 1 0 1 4 4 3 4 3 4 I want to get : 4 3 0 3 4 1 0 1 4 3 4 3 4 two 4 is being repre

[R] Repeated values

2009-03-11 Thread Tammy Ma
Hi,All. How to make a program to delete repeated value? a example > c [1] 4 3 0 3 4 1 0 1 4 4 3 4 3 4 I want to get : 4 3 0 3 4 1 0 1 4 3 4 3 4 two 4 is being represented by one 4. Thanks. Tammy _ More than messages–check out