filter for complete cases in data.frame using dplyr (case-wise deletion)
Try this: df %>% na.omit or this: df %>% filter(complete.cases(.)) or this: library(tidyr) df %>% drop_na If you want to filter based on one variable’s missingness, use a conditional: df %>% filter(!is.na(x1)) or df %>% drop_na(x1) Other answers indicate that of the solutions above na.omit is much slower but that has to be balanced against … Read more