df.2.named.vector: Data frame to named vector

View source: R/df.2.named.vector.R

df.2.named.vectorR Documentation

Data frame to named vector

Description

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.

Usage

df.2.named.vector(.data)

Arguments

.data

A data frame with at least two columns.

Value

A named vector.

Author(s)

Michaja Pehl

Examples

data <- data.frame(names = c("one", "two", "three"), values = 1:3)
data
df.2.named.vector(data)

pik-piam/quitte documentation built on April 26, 2024, 12:58 a.m.