Learn R Programming

toscutil (version 2.8.0)

named: Create automatically named List

Description

Like normal list(), except that unnamed elements are automatically named according to their symbol

Usage

named(...)

Value

Object of type list with names attribute set

Arguments

...

List elements

See Also

Examples

Run this code
a <- 1:10
b <- "helloworld"
l1 <- list(a, b)
names(l1) <- c("a", "b")
l2 <- named(a, b)
stopifnot(identical(l1, l2))
l3 <- list(z = a, b = b)
l4 <- named(z = a, b)
stopifnot(identical(l3, l4))

Run the code above in your browser using DataLab