v_to_df | R Documentation |
Transform a vector to a data.frame. If it has names, these will be added as rownames unless name_col is specified to a chr.
v_to_df(x, value_col = "value", name_col = F)
x |
(vector) A vector. |
value_col |
(chr) Name of the column with values. If NA, will use the name of x. |
name_col |
(chr/lgl) Name of the column with names. If given, will not use rownames and use an explicit column. |
a data.frame
v_to_df(1:4)
v_to_df(c(a = 1, b = 2, c = 3, d = 4))
v_to_df(c(a = 1, b = 2, c = 3, d = 4), name_col = "name")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.