Learn R Programming

cheapr (version 1.1.0)

new_df: Fast data frame constructors

Description

Fast data frame constructors

Usage

new_df(..., .nrows = NULL, .recycle = FALSE, .name_repair = FALSE)

as_df(x)

fast_df(...)

Value

A data.frame

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 FALSE.

x

An object to coerce to a data.frame.

Details

fast_df() is a very fast bare-bones version of new_df() that performs no checks and no recycling or name tidying. All variables must be named and of equal length.