keep_na: Keep rows containing missing values

Description Usage Arguments Value Examples

View source: R/keep_na.R

Description

Keep rows containing missing values

Usage

1
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

1
2
3
4
5
6
7
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))

hacksaw documentation built on Jan. 13, 2021, 7:57 a.m.