Description Usage Arguments Examples
A wraper of tidyr::drop_na()
to drop NA values and give a
warning for how many rows were dropped.
1 | drop_na_verbose(.data, ...)
|
.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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.