compareCoerce {compare} | R Documentation |
Compare two objects for equality, coercing the comparison object to the same class as the model object if necessary beforehand.
compareCoerce(model, comparison, transform = character(), equal = TRUE, ...) ## S3 method for class 'data.frame' compareCoerce(model, comparison, transform=character(), equal=TRUE, ignoreColOrder=FALSE, ignoreNameCase=FALSE, ...)
model |
The “correct” object. |
comparison |
The object to be compared with the |
transform |
A character vector containing any transformations that have been performed on the objects prior to this comparison. |
equal |
Whether to test for equality if the test for identity fails. |
ignoreColOrder |
For data frames, whether to reorder columns by name first. |
ignoreNameCase |
For data frames and lists, whether to ignore the case of names when reordering components by name. |
... |
Arguments passed to |
This function is generic, with methods for logical, integer, numeric, and character vectors, factors, arrays, matrices, tables, data frames, and lists.
The integer and numeric methods use the appropriate special-case coercion for factors.
An object of class "comparison"
.
Use isTRUE()
to determine whether the
comparison has succeeded.
Paul Murrell
compare
and
compareEqual
compareCoerce(letters, factor(letters))