I have a table that contains letters and numbers:
xx <- tibble (letter = c (rep ("a", 3), rep ("b", 3), rep ("c", 3)),
number = c (1, 2, 3, 1, 2, 3, 4, 5, 6))
I would like to first group data by "letter" and then check if there are any two groups that have identical values in number column. These would be groups with letters "a" and "b" in the "letter" column.
The result would look like this
xx <- tibble (letter = c (rep ("a", 3), rep ("b", 3), rep ("c", 3)),
number = c (1, 2, 3, 1, 2, 3, 4, 5, 6),
duplicated = c (rep (TRUE, 6), rep (FALSE, 3)) )
is there a way to do this elegantly in dplyr?