complete.dtplyr_step {dtplyr} | R Documentation |
Complete a data frame with missing combinations of data
Description
This is a method for the tidyr complete()
generic. This is a wrapper
around dtplyr
translations for expand()
, full_join()
, and replace_na()
that's useful for completing missing combinations of data.
Usage
## S3 method for class 'dtplyr_step'
complete(data, ..., fill = list())
Arguments
data |
A |
... |
<
When used with factors, When used with continuous variables, you may need to fill in values
that do not appear in the data: to do so use expressions like
|
fill |
A named list that for each variable supplies a single value to
use instead of |
Examples
library(tidyr)
tbl <- tibble(x = 1:2, y = 1:2, z = 3:4)
dt <- lazy_dt(tbl)
dt %>%
complete(x, y)
dt %>%
complete(x, y, fill = list(z = 10L))