x1 = data.frame(id = c(1L, 1L, 2L, 3L, NA_integer_),
t = c(1L, 2L, 1L, 2L, NA_integer_),
x = 11:15)
is_balanced(df = x1,
by = c("id", "t"),
return = "table") # returns combination of elements in "id" and "t" not present in df
is_balanced(df = x1,
by = c("id", "t"),
return = "logic") # FALSE
Run the code above in your browser using DataLab