add_from_x: Add variables from data sets to pairs

View source: R/add_from_xy.R

add_from_xR Documentation

Add variables from data sets to pairs

Description

Add variables from data sets to pairs

Usage

add_from_x(pairs, ...)

add_from_y(pairs, ...)

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

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




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