I have a data set like:
ID EMAIL_ID.x ID.y EMAIL_ID.y
60842 k@aol.com 60842 k@aol.com
90853 a.b.c NA <NA>
90854 b.c.d NA <NA>
83907 h@gwi.net 02854 <NA>
83908 s@hotmail.com 00952 <NA>
83909 l@rediff.com 78895 <NA>
In this data, i only want to retain the rows in which both the 3rd and the 4th column are either populated or both not populated.
Hence the result should be like:
ID EMAIL_ID.x ID.y EMAIL_ID.y
60842 k@aol.com 60842 k@aol.com
90853 a.b.c NA <NA>
90854 b.c.d NA <NA>
In the above, the rows where column 3 had values but column 4 did not, have been deleted.
Please suggest how can this be done in R.
Thankyou!