If I have a dataframe in R like this,
1 2 abc bh abd NA NA
2 3 abc NA NA NA NA
3 4 NA NA ad yu ae
...................
I want to get those values in columns 1 and 2 which have more than one value in the rest of the column. For example, here, 1 2
has 3 values and 3 4
has 3 values as well and 2 3
has only one value and rest are NA. So, I want 1 2
and 3 4
. How can I do it in R?
Thanks!