all.equal

Paul Gilbert pgilbert@bank-banque-canada.ca
Wed, 13 May 1998 14:38:47 -0400


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._