Learn R Programming

BBmisc (version 1.10)

namedList: Create named list, possibly initialized with a certain element.

Description

Create named list, possibly initialized with a certain element.

Usage

namedList(names, init)

Arguments

names
[character] Names of elements.
init
[valid R expression] If given all list elements are initialized to this, otherwise NULL is used.

Value

[list].

Examples

Run this code
namedList(c("a", "b"))
namedList(c("a", "b"), init = 1)

Run the code above in your browser using DataLab