compare_pairs: Compare all pairs of records

View source: R/compare_pairs.R

compare_pairsR Documentation

Compare all pairs of records

Description

Compare all pairs of records

Usage

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

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




djvanderlaan/reclin documentation built on Oct. 4, 2022, 7:03 p.m.