complete | R Documentation |
Turns implicit missing values into explicit missing values.
complete(.df, ..., fill = list(), .by = NULL)
.df |
A data.frame or data.table |
... |
Columns to expand |
fill |
A named list of values to fill NAs with. |
.by |
Columns to group by |
df <- data.table(x = 1:2, y = 1:2, z = 3:4)
df %>%
complete(x, y)
df %>%
complete(x, y, fill = list(z = 10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.