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

View source: R/complete.R

completeR Documentation

Complete a data.table with missing combinations of data

Description

Turns implicit missing values into explicit missing values.

Usage

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

Arguments

.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

Examples

df <- data.table(x = 1:2, y = 1:2, z = 3:4)

df %>%
  complete(x, y)

df %>%
  complete(x, y, fill = list(z = 10))

tidytable documentation built on Sept. 11, 2024, 8:05 p.m.