Create Named Vector from two Columns of a Data Frame
Source:R/namedVectorFromColumns.R
namedVectorFromColumns.Rd
Create Named Vector from two Columns of a Data Frame
Arguments
- data
a data frame
- valueColumn
name of column in
data
containing the names- nameColumn
name of column in
data
containing the values
Examples
data <- data.frame(a = 1:3, name = LETTERS[1:3])
namedVectorFromColumns(data, valueColumn = "a", nameColumn = "name")
#> A B C
#> 1 2 3