drop_na {tidyr} | R Documentation |
Drop rows containing missing values
drop_na(data, ...)
data |
A data frame. |
... |
Specification of variables to consider while dropping rows.
If empty, consider all variables. Use bare variable names. Select all
variables between x and z with |
drop_na_
for a version that uses regular evaluation
and is suitable for programming with.
library(dplyr) df <- data_frame(x = c(1, 2, NA), y = c("a", NA, "b")) df %>% drop_na() df %>% drop_na(x)