Check Join
Checks if all rows in x match at least one in y using
identical(nrow(x), nrow(merge(x, unique(y[if (is.null(names(by))) by else names(by)]), by = by)))
chk_join(x, y, by, x_name = NULL) vld_join(x, y, by)
x |
The object to check. |
y |
A data.frame with columns in by. |
by |
A character vector specifying the column names to join x and y on. If named the names are the corresponding columns in x. |
x_name |
A string of the name of object x or NULL. |
The chk_
function throws an informative error if the test fails.
The vld_
function returns a flag indicating whether the test was met.
vld_join
: Validate Join
Other chk_set:
chk_not_subset()
,
chk_orderset()
,
chk_superset()
,
vld_not_subset()
,
vld_orderset()
# chk_join chk_join(data.frame(z = 1), data.frame(z = 1:2), by = "z") try(chk_join(data.frame(z = 1), data.frame(z = 2), by = "z")) # vld_join vld_join(data.frame(z = 1), data.frame(z = 1:2), by = "z") vld_join(data.frame(z = 1), data.frame(z = 2), by = "z") vld_join(data.frame(z = 1), data.frame(a = 1:2), by = c(z = "a")) vld_join(data.frame(z = 1), data.frame(a = 2), by = c(z = "a"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.