s-news
[Top] [All Lists]

Re: intersection of 2 dataframes ['Watchdog': checked]

To: s-news@lists.biostat.wustl.edu
Subject: Re: intersection of 2 dataframes ['Watchdog': checked]
From: Paul Matthias Diderichsen <paulmatthias.diderichsen@abbott.com>
Date: Wed, 21 Jun 2006 09:30:59 +0200
In-reply-to: <E1FsiF5-000IcH-4V@pr-webmail-2.demon.net>

Hi Jonathan.

s-news-owner@lists.biostat.wustl.edu wrote on 20.06.2006 17:34:15:
> I have two different dataframes, each with exactly the same columns.
> I wish to identify rows of data which are common to both.  

Are you looking for something like this?

> f<-data.frame(a=c(1,2,3),b=c(2,2,3))
> g<-data.frame(a=c(3,2,1),b=c(2,2,3))
> h<-rbind(f,g)
> h[duplicated(h),]
  a b
5 2 2
>

Kind regards,
Paul M. Diderichsen
============================================================================================================================
The information contained in this communication is confidential, may be subject to legal privileges, may constitute inside information, and is intended only for the use of the addressee. It is the property of Abbott Laboratories or its relevant affiliate. Unauthorized use, disclosure or copying of this communication or any part thereof is strictly prohibited and may be unlawful. If you have received this communication in error, please notify Abbott Laboratories immediately by return e-mail and destroy this communication and all copies thereof, including all attachments.
=============================================================================================================================
<Prev in Thread] Current Thread [Next in Thread>