I have a dataframe:
df <- data.frame(a=c(1,2), b=c(3,4), c=c(3,5), d=c(6,5), e=c(9,2))
I want to write a function that gives me all the possible combinations of the 3 of the column values. The desired output would be
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
1 7 10 13 10 3 16 12 15 18 18
2 11 11 8 12 9 9 14 11 11 12
I would like to write a loop that would go through the different combinations of the n number of the columns, which in this question n=3