Skip to contents
loading...

The presentation of the data (see examples) is easier to read than with the traditional column-wise entry in dtx(). This could be used to enter small tables in R, but do not abuse of it!

Usage

dtx_rows(...)

dtf_rows(...)

dtt_rows(...)

dtbl_rows(...)

Arguments

...

Specify the structure of the data frame by using formulas for variable names like ~x for variable x. Then, use one argument per value in the data frame. It is possible to unquote with !! and to unquote-splice with !!!.

Value

A data frame of class data.frame for dtf_rows(), data.table

for dtt_rows(), tibble tbl_df for dtbl_rows() and the default object with dtx_rows().

Examples

df <- dtx_rows(
  ~x, ~y, ~group,
   1,  3,    "A",
   6,  2,    "A",
   10, 4,    "B"
)
df
#>        x     y  group
#>    <num> <num> <char>
#> 1:     1     3      A
#> 2:     6     2      A
#> 3:    10     4      B