I have a R data frame df below
a b c
1 6 NA
2 NA 4
3 7 NA
NA 8 1
4 9 10
NA NA 7
5 10 8
I want to remove the row which has NA in BOTH a & b
My desired output will be
a b c
1 6 NA
2 NA 4
3 7 NA
NA 8 1
4 9 10
5 10 8
I tried something like this below
df1<-df[(is.na(df$a)==FALSE & is.na(df$b)==FALSE),]
but this removes all the NAs (performs an OR function). I need to do AND operation here.
How do i do it ?