Learn R Programming

fastplyr (version 0.2.0)

f_expand: Fast versions of tidyr::expand() and tidyr::complete().

Description

Fast versions of tidyr::expand() and tidyr::complete().

Usage

f_expand(data, ..., sort = FALSE, .by = NULL, .cols = NULL)

f_complete(data, ..., sort = FALSE, .by = NULL, .cols = NULL, fill = NA)

crossing(..., sort = FALSE)

nesting(..., sort = FALSE)

Value

A data.frame of expanded groups.

Arguments

data

A data frame

...

Variables to expand

sort

Logical. If TRUE expanded/completed variables are sorted. The default is FALSE.

.by

(Optional). A selection of columns to group by for this operation. Columns are specified using tidy-select.

.cols

(Optional) alternative to ... that accepts a named character vector or numeric vector. If speed is an expensive resource, it is recommended to use this.

fill

A named list containing value-name pairs to fill the named implicit missing values.

Details

crossing and nesting are helpers that are basically identical to tidyr's crossing and nesting.