Checks that the columns in data frame x form a many-to-one
join with the corresponding columns in y, ie,
the join is a unique key in y and all the rows in x have a match in y.
Usage
check_join(x, y, by = NULL, all_y = FALSE, x_name = substitute(x),
y_name = substitute(y), error = TRUE)
Arguments
x
The object to check.
y
The parent data frame.
by
A character vector or named character vector of the columns to join by.
all_y
A flag indicating whether all the rows in y should have a match in x.
x_name
A string of the name of the object x.
y_name
A string of the name of the object y.
error
A flag indicating whether to throw an informative error or immediately generate an informative message if the check fails.
Value
An invisible copy of x (if it doesn't throw an error).