Skip to contents

A wrapper with dplyr functions to drop columns with no information (all NA values)

Usage

drop_na_cols(x, unique = TRUE)

Arguments

x

data.frame

unique

logical, if TRUE (default), unique() function will be applied to the result.

Value

data.frame with dropped columns

Examples

x <- data.frame(a = c(1, 2, NA), b = c(NA, NA, NA), c = c(NA, 2, 3))
drop_na_cols(x)
#>    a  c
#> 1  1 NA
#> 2  2  2
#> 3 NA  3