harvest <- tibble(
year = c(2010, 2011, 2013, 2011, 2012, 2014, 2014),
fruit = c(rep(c("kiwi", "cherry"), each = 3), "cherry"),
kilo = sample(1:10, size = 7)
)
is_duplicated(harvest, key = fruit, index = year)
are_duplicated(harvest, key = fruit, index = year)
are_duplicated(harvest, key = fruit, index = year, from_last = TRUE)
duplicates(harvest, key = fruit, index = year)
Run the code above in your browser using DataLab