Check various properties of 2 data frames to ensure they are equivalent.
validate.equal(
df1,
df2,
id.column = NULL,
regex.remove = "[^A-z0-9.+\\/,-]",
do.set.NA = TRUE,
nastrings = easyr::nastrings,
match.round.to.digits = 4,
do.all.columns.before.err = FALSE,
check.column.order = FALSE,
sort.by.id = TRUE,
acceptable.pct.rows.diff = 0,
acceptable.pct.vals.diff = 0,
return.summary = FALSE,
verbose = TRUE
)
May return information about mismatches. Otherwise doesn't return anything (NULL).
First data frame to compare.
Second data frame to compare.
If available, a column to use as an ID. Helpful in various checks and output.
Pattern to remove from strings. Used in gsub to remove characters we don't want to consider when comparing values. Set to NULL, NA, or "" to leave strings unchanged.
Remove NA strings.
Strings to consider NA.
Round numbers to these digits before checking equality.
Check all columns before returning an error. Takes longer but returns more detail. If FALSE, stops at first column that doesn't match and returns mismatches.
Enforce same column order.
Sort by the id column before making comparisons.
If you are OK with differences in a few rows, set this value. If fewer rows in a column don't match, the function will consider the columns equivalent. Iterpreted as a percentage (it gets divided by 100).
If you are OK with small differences in values, set this value. If the difference in numeric values is less, the function will consider the values equivalent. Iterpreted as a percentage (it gets divided by 100) and compared to absolute value of percentage difference.
Return 2 items in a list, the row mismatches and a summary of row mismatches.
Print helpful information via cat().