s-news
[Top] [All Lists]

Re: [S] identical obervations

To: John Thaden <jjthaden@flash.net>, "Man S. Kwok" <mankwok@phoenix.princeton.edu>
Subject: Re: [S] identical obervations
From: srs@io.harvard.edu
Date: Wed, 21 Jul 1999 12:11:51 -0400
Cc: s-news@wubios.wustl.edu
In-reply-to: <3.0.3.32.19990721102927.006dfa88@pop.flash.net>
References: <Pine.GSO.4.03.9907210606270.10134-100000@tucson.Princeton. EDU> <19990721020832.94616.qmail@hotmail.com>
Sender: owner-s-news@wubios.wustl.edu

That won't work.  Consider:  data.frame( x1=c(1:4,1), x2=c(1:4,2),
x3=c(1:4,3)).  The last row is unique, but will be wrongly excluded.

At 10:29 AM 7/21/99 -0500, John Thaden wrote:
>
>: I have a data set of 6 varaibles and 2000 observations. I need to remove
>: repeated observations. Is there a quick way to locate exactly indentical
>: observations in S, without resorting to looping? Thanks in advance.
>
>>  D <- D[!(duplicated(D$x1) & duplicated(D$x2) & duplicated(D$x3)
>+            & duplicated(D$x4) & duplicated(D$x5) & duplicated(D$x6)), ]
>
>John Thaden
>Little Rock, Arkansas, USA
>-----------------------------------------------------------------------
>This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
>send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
>message:  unsubscribe s-news
>
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>