From pgilbert@bank-banque-canada.ca  Wed May 13 19:38:47 1998
From: pgilbert@bank-banque-canada.ca (Paul Gilbert)
Date: Wed, 13 May 1998 14:38:47 -0400
Subject: all.equal
Message-ID: <98May13.144046edt.13459@mailgate.bank-banque-canada.ca>

I need the function all.equal which is in Splus but not yet in R. Below is a
first cut. Comments would be appreciated.

Paul Gilbert
_______

all.equal <- function(obj1, obj2, ...)
  {if(mode(obj1)      != mode(obj2) )      return("modes differ.")
   if(class(obj1)     != class(obj2))      return("classes differ.")
   if(! all(unlist(attributes(obj1)) == unlist(attributes(obj2))))
                                           return("attributes differ.")
   if(! all(unlist(obj1) == unlist(obj2))) return("values differ.")
   T
  }


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


all.equal
Paul Gilbert