Hi @raytong, thank you for your quick response. Unfortunately, your answer didn´t solve my problem, perhaps because I haven´t explain right myself. IDs from "conflict" data.frame have to be found in "segment" data.frame, doesn´t mind ID row or what ID_seg is (1 or 2), it just needs to be in the data.frame "segment" to be FOUND; that is to say, ID2_conf row 1 can be found in ID1_seg row 35. What I would like to stress is that both, ID1_conf and ID2_conf have to be found in the data.frame "segment" to be categorized as FOUND. That IDs are ligated and should be categorized as a set.
I expose another example (I have eliminate column "ID1_seg" just to make things simplier and have all data to be searched in 1 column):
segment<- data.frame(stringsAsFactors=FALSE,
ID1_seg = c("AAAA_AAAB", "AAAC_AAAD", "AAAG_AAAH", "AAAD_AAAD", "AAAD_AAAF", "AAAE_AAAF")
)
conflict<- data.frame(stringsAsFactors=FALSE,
ID1_conf = c("AAAA_AAAB", "AAAB_AAAC", "BBBG_BBBH"),
ID2_conf = c("AAAC_AAAD", "BBBD_BBBF", "BBBE_BBBF")
)
result<- data.frame(stringsAsFactors=FALSE,
ID1_conf = c("AAAA_AAAB", "AAAB_AAAC", "BBBG_BBBH"),
ID2_conf = c("AAAC_AAAD", "BBBD_BBBF", "BBBE_BBBF"),
Result = c("FOUND", "NOT FOUND", "NOT FOUND")
)
As you can see, the solution is the same as the other example, as data has not changed in the "segment" data.frame (only row position has changed).
Hope to have explained right my issue. Thanks anyway 