Use the selected pairs to generate a linked data set
Use the selected pairs to generate a linked data set
link( pairs, selection =NULL, all =FALSE, all_x = all, all_y = all, x = attr(pairs,"x"), y = attr(pairs,"y"), suffixes = c(".x",".y"), keep_from_pairs = c(".x",".y"))
Arguments
pairs: a pairs object, such as generated by pair_blocking
selection: a logical variable with the same length as pairs has rows, or the name of such a variable in pairs. Pairs are only selected when select is TRUE. When missing attr(pairs, "selection") is used when available.
all: return all records from x and y; even those that don't match.
all_x: return all records from x.
all_y: return all records from y.
x: the first data set; when missing attr(pairs, "x") is used.
y: the second data set; when missing attr(pairs, "y") is used.
suffixes: a character vector of length 2 specifying the suffixes to be used for making unique the names of columns in the result.
keep_from_pairs: character vector with names of variables in pairs
that should be included in the output.
Returns
Returns a data.table containing records from x and y and pairs. Columns that occur both in x and y gain a suffix indicating from which data set they are.
Details
Uses the selected pairs to link the two data sets to each other. Renames variables that are in both data sets.