Re: [R] delete repeated values - not unique...

2010-02-17 Thread jorgusch
rle is extremely cool!! This is really an impressive method to reduce vectors to point where you need to do calculations. This really helped! Thanks a lot! jorgusch -- View this message in context: http://n4.nabble.com/delete-repeated-values-not-unique-tp1557625p1559171.html Sent from the R he

Re: [R] delete repeated values - not unique...

2010-02-16 Thread Alex Yuan
rle() is cool. - PhD Candidate in Statistics Dept. of Mathematics & Statistics University of New Hampshire Durham, NH 03824 USA -- View this message in context: http://n4.nabble.com/delete-repeated-values-not-unique-tp1557625p1557728.html Sent from the R help mailing list archive at Nabble.

Re: [R] delete repeated values - not unique...

2010-02-16 Thread Erik Iverson
Ah, the request was 'hidden' in the subject of the message, apologies! Erik Iverson wrote: Well, can you algorithmically describe what you are trying to do? Your example is not sufficient to determine it. For instance, are you trying to: 1) remove repeated elements of a vector and concatenat

Re: [R] delete repeated values - not unique...

2010-02-16 Thread David Winsemius
On Feb 16, 2010, at 12:01 PM, jorgusch wrote: Hello, I must be blind not to see it, but I have the following vector: 4 4 5 6 6 4 What I would like to have as a result is: 4 5 6 4 ?diff > vec <- c(4,4,5,6,6,4) > vec[ c(1, diff(vec)) != 0 ] [1] 4 5 6 4 All repeated values are gone. I c

Re: [R] delete repeated values - not unique...

2010-02-16 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of jorgusch > Sent: Tuesday, February 16, 2010 9:01 AM > To: r-help@r-project.org > Subject: [R] delete repeated values - not unique... > > > Hello,

Re: [R] delete repeated values - not unique...

2010-02-16 Thread Erik Iverson
Well, can you algorithmically describe what you are trying to do? Your example is not sufficient to determine it. For instance, are you trying to: 1) remove repeated elements of a vector and concatenate the first element at the end? 2) remove repeated elements of a vector and concatenate the

Re: [R] delete repeated values - not unique...

2010-02-16 Thread Marc Schwartz
On Feb 16, 2010, at 11:01 AM, jorgusch wrote: > > Hello, > > I must be blind not to see it, but I have the following vector: > > 4 > 4 > 5 > 6 > 6 > 4 > > What I would like to have as a result is: > > 4 > 5 > 6 > 4 > > All repeated values are gone. I cannot use unique for this, as the second

[R] delete repeated values - not unique...

2010-02-16 Thread jorgusch
Hello, I must be blind not to see it, but I have the following vector: 4 4 5 6 6 4 What I would like to have as a result is: 4 5 6 4 All repeated values are gone. I cannot use unique for this, as the second 4 would disappear. Is there another fast function for this problem? Thanks in advance