I am wondering how to perform some basic data manipulation in R. What i want to do is the following.
I have a data table with the following pattern :
V1 V2 V3 ABC X 24 ABC Y 30 EFG X 4 EFG Y 28 HIJ P 40 HIJ Y 41 PKL X 32
Now i want to retrieve all the values/pairs of V1 where it doesn't have a corresponding value which is not X on V2. In the above dataset this subset would be
HIJ P 40 HIJ Y 41
Since neither of the pair of HIJ have a V2 value of X.
I would also like to retrieve all values of V1 that don't repeat twice. In the above example it would be
PKL X 32