keep_na {hacksaw} | R Documentation |
Keep rows containing missing values
Description
Keep rows containing missing values
Usage
keep_na(.data, ..., .logic = "AND")
Arguments
.data |
A table of data. |
... |
A selection of columns. If empty, all columns are selected. |
.logic |
boolean, either 'AND' or 'OR'. Logic for keeping NAs. |
Value
A data frame.
Examples
library(dplyr)
df <- tibble(x = c(1, 2, NA, NA), y = c("a", NA, "b", NA))
df %>% keep_na()
df %>% keep_na(x)
vars <- "y"
df %>% keep_na(x, any_of(vars))
[Package hacksaw version 0.0.2 Index]