I have this data.frame:
> d
x y
1 6 1
2 2 -1
3 3 -1
4 2 -1
5 3 1
6 1 -1
7 4 1
8 7 -1
9 3 -1
10 4 -1
11 8 1
12 4 -1
13 2 -1
14 9 -1
15 5 1
16 7 1
17 6 -1
18 7 -1
19 3 -1
20 2 -1
I want to search for rows that have the same value in column1 and none of them have +1 in column 2. So, in this case, for example, rows that have value x=2 have no y=1, so I want to remove them. same thing also happens for rows with x=9 and x=1.
In another word, if we create subsets of the data by which in each subset, all the x values are the same, then any subset that doesn't have y=1 should be discarded.
Do you have any suggestion? If it is not clear, I will try to elaborate better!