Re: [R] to remove duplicate values

2010-07-05 Thread Charles C. Berry
On Mon, 5 Jul 2010, Moohwan Kim wrote: Dear R family, Suppose I have two series. order value 1 0.52 2 0.23 3 0.43 4 0.21 5 0.32 6 0.32 7 0.32 8 0.32 9 0.32 10 0.12 11 0.46 12 0.09 13 0.32 14 0.25 For these two series, I figured out the way to detect the locations of duplicate values.

Re: [R] to remove duplicate values

2010-07-05 Thread Jannis
Some further tricks will (probably) lead you to your goal. I suppose you use duplicated() or something similar to get an array of locations of the duplicated values: pos.dup <- whcih(duplicated(value)) then do diff.pos.dup <- diff(pos.dup) and you get the indices to delete: pos.delete <- o

[R] to remove duplicate values

2010-07-05 Thread Moohwan Kim
Dear R family, Suppose I have two series. order value 1 0.52 2 0.23 3 0.43 4 0.21 5 0.32 6 0.32 7 0.32 8 0.32 9 0.32 10 0.12 11 0.46 12 0.09 13 0.32 14 0.25 For these two series, I figured out the way to detect the locations of duplicate values. The next thing to do is remove the repeat