Omit rows containing specific column of NA
To solve r remove rows with na in one column, you can use the following methods: Using is.na() function: DF DF x y z 1 1 0 NA 2 2 10 33 3 3 NA 22 > DF[!is.na(DF$y),] x y z 1 1 0 NA 2 2 10 33Using drop_na function from tidyr package: library(tidyr) DF %>% drop_na(y) x y z 1 1 0 NA 2 2 10 33Using complete.cases :
Answered Jun 14, 2021 · 1.2K Views Read answer →