Compare matched rows of two data frames by key (base R)
diff_values_by_key.RdBase-R replacement for diffdf::diffdf(). Matches base
and compare rows on by, then compares every other shared column
row-by-row with compare_values(). With by = NULL, rows are matched
by position instead (matching diffdf::diffdf()'s own behavior when
keys is unset).
Usage
diff_values_by_key(
base,
compare,
by = NULL,
tolerance = sqrt(.Machine$double.eps),
scale = NULL,
strict_factor = FALSE
)Arguments
- base
a data.frame or tibble
- compare
a data.frame or tibble
- by
character vector of shared key column(s), or
NULLto match rows by position (base row 1 vs. compare row 1, etc.)- tolerance, scale, strict_factor
passed to
compare_values()