Entering edit mode

10.4 years ago

viniciushs88
▴
50

I would like to exclude entire lines in matrix "Y" based in 2 collumns in matrix "X":

Matrix "X":

```
number1 number2 inf
gen1 genx1 223
gen1 genx2 221
gen2 genx3 224
gen2 genx5 225
```

Matrix "Y":

```
numberall inf
gen1 223
genx1 256
gen2 225
genx2 214
gen3 563
genx3 235
gen4 256
genx4 568
```

Expected output matrix

```
numberall inf
gen3 563
gen4 256
genx4 568
```

Cheers.

`%in%`

also works with a matrix, so you don't need`exclude = c(x[,1],x[,2])`

:That's good to know!