I have two datasets, and am trying to filer columns in R based on these. The first dataset has three columns; two identifiers and a SNP value. The second only has identifiers in one column.
I am trying to filter such that if the second data sets identifiers are in either of the first datasets columns, the row is not deleted. However, if the first dataset has identifiers that are not in the second date set, that row should be deleted. Can I use dplyr/something else to do so? I have been trying to define a subset of matches and then use this to filter but I'm not sure exactly how to best do so.