Good morning,
I am trying to do network analysis, and from this table named "demo" with the relationship between people and products:
demo <- tribble(
~product_id, ~person_id,
1, 240,
1, 354,
2, 85,
2, 647,
2, 34,
)
I need to generate the following table "demo2" to get all collaborations between people who made the same product.
demo2 <- tribble(
~person_1, ~person_2,
240, 354,
85, 647,
85, 34,
647, 34,
)
Does anyone know how to do it with tidyr or base code?
Thanks in advance!