named_list: Create a Named List from Objects in Environment

View source: R/named_list.R

named_listR Documentation

Create a Named List from Objects in Environment

Description

Creates a list where elements are automatically named using their input variable names. Uses non-standard evaluation to capture the variable names as they appear in the function call.

Usage

named_list(...)

Arguments

...

Unquoted variable names that will become both the list elements and their names

Value

A named list where each element's name matches its input variable name

Examples

x <- 1
y <- "hello"
z <- data.frame(a = 1:3)

# Creates list with names "x", "y", "z"
my_list <- named_list(x, y, z)


donboyd5/btools documentation built on Dec. 11, 2024, 12:23 p.m.