I would like to regroup element if they share a common values in two different columns. What would be the best way?
Input:
tibble(a = c("C1", "C2", "C12", "C15", "C12"), b = c("C4", "C3", "C2", "C18", "C21"))
Desired output:
list( c("C1", "C4"), c("C2", "C3", "C12", "C21"), c("C15", "C18"))
or
tibble(name = c("C1", "C2", "C12", "C15", "C4", "C3", "C18", "C21"), id_group= c(1, 2, 2, 3, 1, 2,3, 2))