if (FALSE) {
# example with data frame uniquely identified by specified `by` vars
x1 = data.frame(id = c(1L, 1L, 2L, 3L, NA_integer_),
t = c(1L, 2L, 1L, 2L, NA_integer_),
x = 11:15)
joyn:::is_valid_m_key(x1, by = c("id", "t"))
# example with valid specified "many" relationship
x2 = data.frame(id = c(1L, 1L, 1L, 3L, NA_integer_),
t = c(1L, 2L, 1L, 2L, NA_integer_),
x = 11:15)
joyn:::is_valid_m_key(x2, by = c("id", "t"))
}
Run the code above in your browser using DataLab