check_match_type | R Documentation |
This function checks if the match type chosen by the user is consistent with the data.
(Match type must be one of the valid types: "1:1", "1:m", "m:1", "m:m")
check_match_type(x, y, by, match_type, verbose = getOption("joyn.verbose"))
x , y |
|
by |
A vector of shared column names in |
match_type |
character: one of "m:m", "m:1", "1:m", "1:1". Default is "1:1" since this the most restrictive. However, following Stata's recommendation, it is better to be explicit and use any of the other three match types (See details in match types sections). |
character vector from split_match_type
## Not run:
# Consistent match type
x1 = data.frame(
id = c(1L, 1L, 2L, 3L, NA_integer_),
t = c(1L, 2L, 1L, 2L, NA_integer_),
x = 11:15)
y1 = data.frame(id = 1:2,
y = c(11L, 15L))
joyn:::check_match_type(x = x1, y=y1, by="id", match_type = "m:1")
# Inconsistent match type
joyn:::check_match_type(x = x1, y=y1, by="id", match_type = "1:1")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.