Skip to contents

This is a convenient way to drop uninformative rows from a data frame.

Usage

drop_na_all(data, ...)

Arguments

data

A data frame.

...

<tidy-select> Columns to inspect for missing values. If empty, all columns are used.

Value

The original data frame with rows for which all values are missing dropped.

Examples

data <- tibble::tibble(
  a = c(NA, NA, NA), b = c(1, 1, NA), c = c(2, NA, NA)
)

drop_na_all(data)
#> # A tibble: 2 × 3
#>   a         b     c
#>   <lgl> <dbl> <dbl>
#> 1 NA        1     2
#> 2 NA        1    NA
drop_na_all(data, a, c)
#> # A tibble: 1 × 3
#>   a         b     c
#>   <lgl> <dbl> <dbl>
#> 1 NA        1     2