dplyr (version 0.4.2)

data_frame: Build a data frame.

Description

A trimmed down version of data.frame that:
  1. Never coerces inputs (i.e. strings stay as strings!).
  2. Never adds row.names.
  3. Never munges column names.
  4. Only recycles length 1 inputs.
  5. Evaluates its arguments lazily and in order.
  6. Adds tbl_df class to output.

Usage

data_frame(...)

data_frame_(columns)

Arguments

...
A set of named arguments
columns

See Also

as_data_frame to turn an existing list into a data frame.

Examples

Run this code
a <- 1:5
data_frame(a, b = a * 2)
data_frame(a, b = a * 2, c = 1)
data_frame(x = runif(10), y = x * 2)

# data_frame never coerces its inputs
str(data_frame(letters))
str(data_frame(x = list(diag(1), diag(2))))

# or munges column names
data_frame(`a + b` = 1:5)

# With the SE version, you give it a list of formulas/expressions
data_frame_(list(x = ~1:10, y = quote(x * 2)))

Run the code above in your browser using DataCamp Workspace