Learn R Programming

poorman (version 0.2.6)

lst: Build a list

Description

lst() constructs a list, similar to base::list(), but where components are built sequentially. When defining a component, you can refer to components created earlier in the call. lst() also generates missing names automatically.

Usage

lst(...)

Value

A named list.

Arguments

...

Named or unnamed elements of a list. If the element is unnamed, its expression will be used as its name.

Examples

Run this code
# the value of n can be used immediately in the definition of x
lst(n = 5, x = runif(n))

# missing names are constructed from user's input
lst(1:3, z = letters[4:6], runif(3))

a <- 1:3
b <- letters[4:6]
lst(a, b)

Run the code above in your browser using DataLab