replace_na.tbl_lazy: Replace NAs with specified values

View source: R/verb-expand.R

replace_na.tbl_lazyR Documentation

Replace NAs with specified values

Description

This is a method for the tidyr::replace_na() generic.

Usage

## S3 method for class 'tbl_lazy'
replace_na(data, replace = list(), ...)

Arguments

data

A pair of lazy data frame backed by database queries.

replace

A named list of values, with one value for each column that has NA values to be replaced.

...

Unused; included for compatibility with generic.

Value

Another tbl_lazy. Use show_query() to see the generated query, and use collect() to execute the query and return data to R.

Examples


df <- memdb_frame(x = c(1, 2, NA), y = c("a", NA, "b"))
df %>% tidyr::replace_na(list(x = 0, y = "unknown"))


dbplyr documentation built on May 29, 2024, 6:19 a.m.