compare_pairs: Compare all pairs of records

Description Usage Arguments Value Examples

View source: R/compare_pairs.R

Description

Compare all pairs of records

Usage

1
2
3
4
5
6
7
8
9
compare_pairs(
  pairs,
  by,
  comparators = list(default_comparator),
  x,
  y,
  default_comparator = identical(),
  overwrite = FALSE
)

Arguments

pairs

a pairs object, such as generated by pair_blocking

by

variables from x and y on which to compare the records.

comparators

a names list of comparator functions, for the named variables the given functions will be used to compare the records. For the remaining variables the default_comparator will be used.

x

the first data.frame, when missing attr(pairs, "x") is used.

y

the second data.frame, when missing attr(pairs, "y") is used.

default_comparator

the default comparison function.

overwrite

overwrite exiting variables in pairs

Value

Returns the pairs object with a column added for each variable in by. The value is the column is given by the return value of the corresponding comparison function.

Examples

1
2
3
data("linkexample1", "linkexample2")
pairs <- pair_blocking(linkexample1, linkexample2, "postcode")
pairs <- compare_pairs(pairs, c("lastname", "firstname", "address", "sex"))

reclin documentation built on Nov. 23, 2021, 9:09 a.m.