Learn R Programming

reclin (version 0.1.2)

add_from_x: 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

Run this code
# NOT RUN {
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

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab