complete.dtplyr_step {dtplyr} | R Documentation |
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.
## S3 method for class 'dtplyr_step'
complete(data, ..., fill = list())
data |
A |
... |
Specification of columns to expand. Columns can be atomic vectors or lists.
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 |
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))