I have
df <- data.frame(id = c(c(letters[1:4]), c(LETTERS[5:8])),
group = c(rep("same", length = 4), rep("opp", length = 4)),
match = c("H", "G", "E", "F", "c", "d", "b", "a"))
where each id (row) is uniquely paired with one other id in the list. Hoping to find tidyverse solution to create an indicator column showing unique pairings using sequential numbers assigned to each pair. So the result would be the output of
df <- data.frame(pair = c(1,2,3,4,3,4,2,1), id = c(c(letters[1:4]), c(LETTERS[5:8])),
group = c(rep("same", length = 4), rep("opp", length = 4)),
match = c("H", "G", "E", "F", "c", "d", "b", "a"))