cols_to_map: cols_to_map

View source: R/utils.R

cols_to_mapR Documentation

cols_to_map

Description

Generates a named list based on two columns from a data frame.

Usage

cols_to_map(dataframe, key, value)

Arguments

dataframe

A data frame

key

A string of a column name in the data frame

value

A string of a column name in the data frame

Value

A named list, with the names from the key field and values from the value field

Examples

cols_to_map(mtcars, key = "cyl", value = "mpg")

castoredc/castoRedc documentation built on Aug. 4, 2024, 5:24 a.m.