Learn R Programming

dtplyr (version 1.3.1)

drop_na.dtplyr_step: Drop rows containing missing values

Description

This is a method for the tidyr drop_na() generic. It is translated to data.table::na.omit()

Usage

# S3 method for dtplyr_step
drop_na(data, ...)

Arguments

data

A lazy_dt().

...

<tidy-select> Columns to inspect for missing values. If empty, all columns are used.

Examples

Run this code
library(dplyr)
library(tidyr)

dt <- lazy_dt(tibble(x = c(1, 2, NA), y = c("a", NA, "b")))
dt %>% drop_na()
dt %>% drop_na(x)

vars <- "y"
dt %>% drop_na(x, any_of(vars))

Run the code above in your browser using DataLab