nameByElement: Name List Elements by Sublist Element

View source: R/list.R

nameByElementR Documentation

Name List Elements by Sublist Element

Description

name the elements of a list of lists by the value of the element elementName of each sublist

Usage

nameByElement(x, elementName = "name")

Arguments

x

list of lists

elementName

name of element to be looked up in each sublist of x

Examples

L <- list(
  list(group = "A", value = 1),
  list(group = "B", value = 2)
)

nameByElement(L, "group")


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.