s-news
[Top] [All Lists]

Re: Removing duplicates from Rows : Summary

To: s-news@lists.biostat.wustl.edu
Subject: Re: Removing duplicates from Rows : Summary
From: Jagadish Rangrej <jrangrej@yahoo.com>
Date: Tue, 27 Sep 2005 13:58:14 -0700 (PDT)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=keIVj4UEO61vRGJwLRv4f0Zt5C8DMs2IiRSoADHJN8XOSu/zscXLULY5WWQsvuoEDHvrYpo43jnH2AlcJNReHayvLMF0/gK5RsdXI7a/DdHuurTkoZFflrd5xT/ARM2DxWCU+7z6jsSfBgaFx2z3pw3OunZvM7/h+vLVJGKoc3s= ;
In-reply-to: <4339AEA7.9010101@pdf.com>
Hi !!

Thanks to Sundar and Brad and John for their replies.
use of "unique" and "duplicated" functions can help.

as well as the the function by John Walter:

ToRemoveDups<-function(foo3, Locx,Locy)
{
        x <- foo3[, Locx]
        y <- foo3[, Locy]
        x.pairs <- paste(x, y)  # create vector of the
pairs
        x.dup <- duplicated(x.pairs)    # vector
indicating the duplicates
        removedups <- cbind(foo3, x.dup)
        removedups[removedups[, dim(removedups)[2]] ==
FALSE,  ]
}


can be useful.

Thanks to everybody,
Jag



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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