Dear all, I understand identical (a,b) will tell me if a and b are exactly the same or not. But what if they are different, is there anyway to tell which element(s) are different? Thanks. Jun [[alternative HTML version deleted]]
David Winsemius
2010-Apr-08 01:36 UTC
[R] How to locate the difference from two data frames
On Apr 7, 2010, at 9:31 PM, Jun Shen wrote:> Dear all, > > I understand identical (a,b) will tell me if a and b are exactly the > same or > not. But what if they are different, is there anyway to tell which > element(s) are different? Thanks.You could try: str(a); str(b) David Winsemius, MD West Hartford, CT
Charles C. Berry
2010-Apr-08 03:46 UTC
[R] How to locate the difference from two data frames
On Wed, 7 Apr 2010, Jun Shen wrote:> Dear all, > > I understand identical (a,b) will tell me if a and b are exactly the same or > not. But what if they are different, is there anyway to tell which > element(s) are different? Thanks.which( a != b, arr.ind = TRUE) HTH, Chuck> > Jun > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >Charles C. Berry (858) 534-2098 Dept of Family/Preventive Medicine E mailto:cberry at tajo.ucsd.edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901