Description Usage Arguments Details Value See Also Examples
Convert vectors to data tables and vice versa
1 | entable(x, key = ".key", value = as.character(substitute(x)))
|
x |
atomic vector |
key, value |
Names of the columns that store the keys and values. |
entable
converts a data.table from an atomic vector. The vector becomes a
table column named value
which, by default, is named after x
.
If the vector is named, a two-column data table is produced. The first
column is the names of x and is named by the key
argument. The key
defaults to .key
.
A key is created for the first column.
A one or two column data.table with a key on the first column.
data.table::setkey()
tibble::enframe()
- from which this function is loosely inspired.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.