Learn R Programming

tidytable (version 0.5.8)

complete.: Complete a data.table with missing combinations of data

Description

Turns implicit missing values into explicit missing values.

Usage

complete.(.df, ..., fill = list())

Arguments

.df

A data.frame or data.table

...

Columns to expand

fill

A named list of values to fill NAs with.

Examples

Run this code
# NOT RUN {
test_df <- data.table(x = 1:2, y = 1:2, z = 3:4)

test_df %>%
  complete.(x, y)

test_df %>%
  complete.(x, y, fill = list(z = 10))
# }

Run the code above in your browser using DataLab