[R] Identical data frames

Francisco J. Zagmutt gerifalte28 at hotmail.com
Wed Sep 21 20:36:38 CEST 2005


you just said t.  identical() will compare *strict* equality
i.e.

d1=data.frame(x=,y=1:30)
d2=d1
identical(d1,d2)
[1] TRUE

d1=data.frame(x=letters,y=1:26)
d2=data.frame(x=c("aa",letters[2:26]), y=1:26)
identical(d1,d2)
[1] FALSE #because The first row of d2$x was "aa" and in d1 was "a"

Cheers

Francisco

>From: Marc Bernard <bernarduse1 at yahoo.fr>
>To: r-help at stat.math.ethz.ch
>Subject: [R] Identical  data frames
>Date: Wed, 21 Sep 2005 16:07:13 +0200 (CEST)
>
>Dear All,
>
>Is there any R  function to test if two  data frames, say df1 and df2,  
>having the same  row names  and the same column names  are identiques?
>
>Thanks in advance,
>
>Bernard
>
>
>
>
>---------------------------------
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! 
>http://www.R-project.org/posting-guide.html




More information about the R-help mailing list