my data set looks like this (in the real dataset they're like 12 observations)
ID String
1 BDH
2 BDHV
3 PA
4 PmA
And I want all combinations, but taking it into account that 1,2 = 2,1
So the desired dataset looks like this:
ID String
1 BDH
2 BDHV
3 PA
4 PmA
12 BDH;BDHV
123 BDH;BDHV;PA
1234 BDH;BDHV;PA;PmA
23 BDHV;PA
234 BDHV;PA;PmA
34 PA;PmA
How can I do this using R?
I think I got to use paste(, sep=";")
for the String variable, but still don't know how to make the combinations.