nuyaying said the following on 9/13/2007 9:50 AM:
>
> I have a data set with 3 variables V1, V2, V3. If there are 2 data points
> have the same values on both V1 and V2, I want to delete one of them which
> has smaller V3 value.i.e., in the data below, I want to delete
> the first observa
Here a way of doing it:
> x <- cbind(V1=sample(1:3,20,TRUE), V2=sample(1:3,20,TRUE), V3=sample(20))
> x
V1 V2 V3
[1,] 2 2 1
[2,] 1 2 6
[3,] 3 2 10
[4,] 3 1 11
[5,] 3 2 5
[6,] 3 2 7
[7,] 2 1 19
[8,] 3 3 13
[9,] 1 3 2
[10,] 3 3 20
[11,] 3 3 18
[12,] 2 1 4
gt; From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of nuyaying
> Sent: Thursday, September 13, 2007 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: [R] How to delete a duplicate observation
>
>
>
> I have a data set with 3 variables V1, V2, V3. If there are
&
nuyaying wrote:
> I have a data set with 3 variables V1, V2, V3. If there are 2 data points
> have the same values on both V1 and V2, I want to delete one of them which
> has smaller V3 value.i.e., in the data below, I want to delete
> the first observation. How can I do that ?Thanks in
I have a data set with 3 variables V1, V2, V3. If there are 2 data points
have the same values on both V1 and V2, I want to delete one of them which
has smaller V3 value.i.e., in the data below, I want to delete
the first observation. How can I do that ?Thanks in advance!
V1 V
5 matches
Mail list logo