list.names: Get or set the names of a list by expression

View source: R/list.names.R

list.namesR Documentation

Get or set the names of a list by expression

Description

Get or set the names of a list by expression

Usage

list.names(.data, expr)

Arguments

.data

A list or vector

expr

the expression whose value will be set as the name for each list element. If missing then the names of the list will be returned. If NULL then the names of the list will be removed.

Examples

list.names(c(1,2,3))
list.names(c(a=1,b=2,c=3))
list.names(c(1,2,3),letters[.])
list.names(list(list(name='A',value=10),list(name='B',value=20)), name)

renkun-ken/rlist documentation built on March 16, 2023, 8:25 p.m.