Right now I have the following table hypothetically:
.1 .2 .3
.2 1 C
.2 1 C
.2 1 C
.3 1 N
.3 1 N
.4 1 N
.4 1 N
.4 1 N
.4 1 N
We only want to keep the rows that contain a C for column 3 given that column 2 is the same AND the values for column 1 are different. This should result in the following table:
.1 .2 .3
.2 1 C
.2 1 C
.2 1 C
I already looked at the following questions:
Remove duplicates based on 2nd column condition
R, conditionally remove duplicate rows
Conditionally removing duplicates in R
Do you have any idea how to achieve this?