drop_na {tidyr}R Documentation

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

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

[Package tidyr version 0.6.0 Index]