[R] Exclude lines in based in multiple strings
arun
smartpink111 at yahoo.com
Mon Feb 10 22:49:29 CET 2014
Hi,
Try:
##Assuming X and Y are matrices (as stated)
Y[!Y %in% X,,drop=FALSE]
# numberall
#[1,] "gen3"
#[2,] "gen4"
#[3,] "genx4"
A.K.
I would like to exclude entire lines in matrix "Y" based in 2 collumns in matrix "X":
Matrix "X":
number1 number2
gen1 genx1
gen1 genx2
gen2 genx3
gen2 genx5
Matrix "Y":
numberall
gen1
genx1
gen2
genx2
gen3
genx3
gen4
genx4
Expected output matrix
numberall
gen3
gen4
gen4x
Cheers.
More information about the R-help
mailing list