Skip to contents

This function is a wrapper around list() that assigns names to unnamed arguments based on the unevaluated expression used in the call.

Usage

nlist(...)

Arguments

...

List items, possibly named

Value

A named list.

Author

Hadley Wickham

Examples

a <- 1
b <- 2
c <- 3
nlist(a, b, d = c)
#> $a
#> [1] 1
#> 
#> $b
#> [1] 2
#> 
#> $d
#> [1] 3
#> 
nlist(mean(c(a, b, c)))
#> $`mean(c(a, b, c))`
#> [1] 2
#>