TRUE
or a message about what is different between the two objects.
factor
.
In addition there is a default method.
all.equal(target, current, tolerance=, ...)
sqrt(.Machine$double.eps)
.
The test used is on absolute difference if the target value is near zero
and on relative difference otherwise, measured in mean absolute values (not mean
square).
TRUE
.
Otherwise, returns a character vector giving all the discovered differences.
The
all.equal
methods are fussy tests that will generally report any differences
even those that might sometimes be considered irrelevant.
For example, using
dump
on a function,
then
restore
may result
in an equivalent function with comments parsed differently (and
which prints with different white space).
The only substantial leniency in the default methods is that
numerical equality is tested only up to
tolerance
.
Additional leniency can be built in by writing methods for special classes
of objects.
new.fit <- update(old.fit) all.equal(new.fit,old.fit) # Compare two functions which may differ only in comment parsing reparse <- function(x) parse(text=deparse(x))[[1]] all.equal(reparse(f1), reparse(f2))