drop_na_verbose: Drop NA verbose

Description Usage Arguments Examples

View source: R/misc.R

Description

A wraper of tidyr::drop_na() to drop NA values and give a warning for how many rows were dropped.

Usage

1

Arguments

.data

A data frame or similar object.

...

A selection of columns. If empty, all variables are selected. You can supply bare variable names, select all variables between x and z with x:z, exclude y with -y. For more options, see the dplyr::select() documentation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
set.seed(0)
data <- tibble::tibble(.rows = 40)
data$x1 <- sample(c(NA_real_, 1:4), 40, replace= TRUE)
data$x2 <- sample(c(NA_real_, 1:4), 40, replace= TRUE)
drop_na_verbose(data) # filter any NA column
drop_na_verbose(data, x1) # filter when x1 is NA
drop_na_verbose(data, -x2) # filter when any column, not including x2, is NA

## End(Not run)

mattle24/mattle24utils documentation built on May 6, 2019, 4:33 p.m.