I have this type of data frame
DF
ID V1 V2 V3
1 AXETINE NA 2011
2 XOROX INJ NA
3 HERPESIN NA NA
4 ZOVIRAX INJ 2015
and I would like to get this:
DF
ID V1 V2 V3
1 AXETINE NA 2011
4 ZOVIRAX INJ 2015
I would like to get only rows with non NA values in V3
I have tried:
DF %>% na.omit(V3)
and
DF %>% select(!is.na(V3))
But this error occurs
Error: Must subset columns with a valid subscript vector.
I found a base R solution, but is there a dplyr one?