rowwise_dt: Create a data.table rowwisely

Description Usage Arguments Value Note Examples

View source: R/rowwise-dt.R

Description

rowwise_dt allows the user to create a data.table object by specifying a row-by-row layout. It's convenient and highly readable when the table is small.

Usage

1

Arguments

...

Arguments that defines the structure of a data.table. The column names must be specified as col= and may only appear before the data. See the examples section for details.

Value

A data.table object. The default is for each column to return as a vector. However, if any column has a length that is not one (e.g., list(1, 2)), the whole column will be converted to a list column.

Note

This function has been filed to data.table in PR#4291, where the function name is rowwiseDT.

Examples

1
2
3
4
5
 rowwise_dt(
   A=, B=, C=,
   1, "a", 2:3,
   2, "b", list(5)
 )

shrektan/dtkit documentation built on Nov. 26, 2021, 10:50 p.m.