powered by
cbind a table's values with its names to form id (from the names) and content columns.
cbind
table
names
id
content
tidy_table(x, id.name = "id", content.name = "content", ...)
Returns a data.table with the names
data.table
from the table as an id column.
A table.
The name to use for the column created from the table names.
The name to use for the column created from the table values.
ignored.
x <- table(sample(LETTERS[1:6], 1000, TRUE)) tidy_table(x)
Run the code above in your browser using DataLab