I have the following DataFrame in R:
df = data.frame(id = c(1,1,1,2,2),
                year = c(2000, 2000, 2000, 2001, 2001),             
                name= c("A", "B", "C", "D", "E"))  
I need to create an edge-list for network analysis. For each id, I want all the possible combinations (without repetition) of the values in name.
Here below is the desired output:
df = data.frame(id = c(1,1,1,2),
                year = c(2000, 2000, 2000, 2001),             
                name1= c("A", "A", "B", "D"),
                name2= c("B", "C", "C", "E"))  
 
                        
Try the following
data.tableoption usingcombn