Re: [R] To detect the location of duplicate values

2010-07-05 Thread Charles Berry
Charles C. Berry tajo.ucsd.edu> writes: > > On Mon, 5 Jul 2010, Moohwan Kim wrote: > > > Dear R family, > > > > I have a question about how to detect some duplicate numeric observations. > > Suppose that I have two variables dataset. > > > > order value > > 1 0.52 > > 2 0.23 > > 3 0.43 > > 4

Re: [R] To detect the location of duplicate values

2010-07-05 Thread Charles C. Berry
On Mon, 5 Jul 2010, Moohwan Kim wrote: Dear R family, I have a question about how to detect some duplicate numeric observations. Suppose that I have two variables dataset. 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.2

Re: [R] To detect the location of duplicate values

2010-07-05 Thread Joshua Wiley
Hello Moohwan, Look at ?duplicated for example: > x [1] 1 1 2 2 3 3 > duplicated(x) [1] FALSE TRUE FALSE TRUE FALSE TRUE If your end goal is to get rid of the duplicates, take a look at ?unique > unique(x) [1] 1 2 3 Best Regards, Josh On Mon, Jul 5, 2010 at 9:31 AM, Moohwan Kim wrote: >

Re: [R] To detect the location of duplicate values

2010-07-05 Thread jim holtman
try this" > x order value 1 1 0.52 2 2 0.23 3 3 0.43 4 4 0.21 5 5 0.32 6 6 0.32 7 7 0.32 8 8 0.32 9 9 0.32 1010 0.12 1111 0.46 1212 0.09 1313 0.32 1414 0.25 > # go both ways to capture all duplicates > which(duplicat

Re: [R] To detect the location of duplicate values

2010-07-05 Thread Henrique Dallazuanna
Try this: DF[duplicated(DF$value),] On Mon, Jul 5, 2010 at 1:31 PM, Moohwan Kim wrote: > Dear R family, > > I have a question about how to detect some duplicate numeric observations. > Suppose that I have two variables dataset. > > order value > 1 0.52 > 2 0.23 > 3 0.43 > 4 0.21 > 5 0.32 >