Learn R Programming

tidyr (version 0.6.1)

drop_na: Drop rows containing missing values

Description

Drop rows containing missing values

Usage

drop_na(data, ...)

Arguments

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 x:z, exclude y with -y. For more options, see the select documentation.

See Also

drop_na_ for a version that uses regular evaluation and is suitable for programming with.

Examples

Run this code
library(dplyr)
df <- data_frame(x = c(1, 2, NA), y = c("a", NA, "b"))
df %>% drop_na()
df %>% drop_na(x)

Run the code above in your browser using DataLab