add_from_x: Add variables from data sets to pairs

Description Usage Arguments Value Examples

View source: R/add_from_xy.R

Description

Add variables from data sets to pairs

Usage

1
2
3

Arguments

pairs

a pairs object, such as generated by pair_blocking

...

a set of option of the form newvarname = "varname", where varname is a column in x or y.

Value

A pairs object which contains all column of the original pairs with the new columns added to it. An error is generated when it is attempted to add variables that already exist in pairs.

Examples

1
2
3
4
5
6
data("linkexample1", "linkexample2")
pairs <- pair_blocking(linkexample1, linkexample2, "postcode")
pairs <- compare_pairs(pairs, c("lastname", "firstname", "address", "sex"))
pairs <- add_from_x(pairs, id_x = "id")
pairs <- add_from_y(pairs, id_y = "id")
pairs$true_match <- pairs$id_x == pairs$id_y

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