I have two tables with different row numbers. I would like to merge the tables based on the content of two columns. However, the catch is I don't want the order of the variables to matter when merging. Example:

## Table1:

```
Gene1 Gene2 p-value
TP53 ARID1A 0.001
ATM ATR 0.0005
```

## Table2:

```
Gene1 Gene2 p-value
ARID1A TP53 0.0007
ATM ATR 0.004
```

I tried:

```
merge(Table1, Table2, by = c("Gene1", "Gene2"), all.x = TRUE)
```

But the problem is that it will only merge 'ATM' and 'ATR' but not 'TP53' and 'ARID1A' because they are not in the same order.

Is there a way to merge the two tables irrespective of the column order?

`merge(t1,t2,by=c("Gene1","Gene2"),all=TRUE)`

.`TP53 ARID1A 0.001 0.0007`

for the first row and of course`ATM ATR 0.0005 0.004`

for the second row. So basically, that the rows will be merged when the combination of Gene1 and Gene2 are shared between the two tables but not necessary in that order. Thanks!