View source: R/df.2.named.vector.R
df.2.named.vector | R Documentation |
Turns the two first columns of a data frame into a named vector, taking the values from the second and the names from the first column.
df.2.named.vector(.data)
.data |
A data frame with at least two columns. |
A named vector.
Michaja Pehl
data <- data.frame(names = c("one", "two", "three"), values = 1:3)
data
df.2.named.vector(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.