Learn R Programming

fastplyr (version 0.2.0)

new_tbl: Fast 'tibble' alternatives

Description

Fast 'tibble' alternatives

Usage

new_tbl(..., .nrows = NULL, .recycle = TRUE, .name_repair = FALSE)

f_enframe(x, name = "name", value = "value")

f_deframe(x)

as_tbl(x)

Value

A tibble or vector.

Arguments

...

Key-value pairs.

.nrows

integer(1) (Optional) number of rows.
Commonly used to initialise a 0-column data frame with rows.

.recycle

logical(1) Should arguments be recycled? Default is FALSE.

.name_repair

logical(1) Should duplicate names be made unique? Default is TRUE.

x

A data frame or vector.

name

character(1) Name to use for column of names.

value

character(1) Name to use for column of values.

Details

new_tbl and as_tbl are alternatives to tibble and as_tibble respectively. One of the main reasons that these do not share the same name prefixed with f_ is because they don't always return the same result. For example new_tbl() does not support 'quosures' and tidy injection.

f_enframe(x) where x is a data.frame converts x into a tibble of column names and list-values.