compareEqual(model, comparison, transform = character(), ...)
"compareEqual"(model, comparison, transform = character(), ...)
"compareEqual"(model, comparison, transform = character(), round=FALSE, ...)
"compareEqual"(model, comparison, transform=character(), ignoreCase=FALSE, trim=FALSE, ...)
"compareEqual"(model, comparison, transform=character(), dropLevels=FALSE, ignoreLevelOrder=FALSE, ...)
"compareEqual"(model, comparison, transform=character(), ignoreDimOrder=FALSE, ...)
"compareEqual"(model, comparison, transform=character(), ignoreDimOrder=FALSE, ...)
"compareEqual"(model, comparison, transform=character(), ignoreDimOrder=FALSE, ...)
"compareEqual"(model, comparison, transform=character(), ignoreColOrder=FALSE, ignoreNameCase=FALSE, ..., recurseFun=compareEqual)
"compareEqual"(model, comparison, transform=character(), ignoreComponentOrder=FALSE, ignoreNameCase=FALSE, ..., recurseFun=compareEqual)
model
. FALSE
there is no rounding, if TRUE
both objects
are rounded to zero decimal places, if an integer value, then
both objects are rounded to the specified number of decimal
places. May also be a function (of one argument). "comparison"
.
Use isTRUE()
to determine whether the
comparison has succeeded.
identical()
), then if that fails and equal=TRUE
,
compares the objects for equality. The arguments allow for
various relaxations on what equal means.
For numeric vectors, the comparison uses all.equal()
to allow for differences in floating-point representation.
The round
argument also allows for much more lenient
comparisons. The round
argument can also be a function,
e.g., floor()
(see other examples below).
compare
compareEqual(letters, paste(" ", letters, " "), trim=TRUE)
compareEqual(c(.1, 1, 10), c(.13, 1.3, 13),
round=function(x) { signif(x, 1) })
Run the code above in your browser using DataLab