Skip to contents

Detect possible duplicates of rows or columns after a join

Usage

join_check(after, before, halt_fn = rlang::warn)

Arguments

after

(data.frame) after the join

before

(data.frame) from before the join Optional but required for row comparison.

halt_fn

(function) to notify, default warn.

Examples

a = data.frame(a = c(1, 2, 3, 4, 3, 5), b = 1:6)
b = data.frame(a = c(1, 2, 3, 4, 5), c = letters[1:5])
after <- dplyr::left_join(a, b)
#> Joining with `by = join_by(a)`
join_check(b, after, halt_fn = message)
#> Possible join issues detected!
#>  - Row count discrepancies:
#> after - 6
#> b - 5