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