rowwise_table: Row-Wise Constructor for 'data.table'

View source: R/rowwise_table.R

rowwise_tableR Documentation

Row-Wise Constructor for 'data.table'

Description

Similar to the tibble function tribble(), this function allows to construct tabular data in a row-wise fashion.

The first arguments passed as formula will be interpreted as column names. The remaining arguments will be put into the resulting table.

Usage

rowwise_table(..., .key = NULL)

Arguments

...

(any)
Arguments: Column names in first rows as formulas (with empty left hand side), then the tabular data in the following rows.

.key

(character(1))
If not NULL, set the key via data.table::setkeyv() after constructing the table.

Value

data.table::data.table().

Examples

rowwise_table(
  ~a, ~b,
  1, "a",
  2, "b"
)

mlr3misc documentation built on Sept. 20, 2023, 5:06 p.m.