selectFromList: Select variables from a list of objects of the same type

View source: R/Args.R

selectFromListR Documentation

Select variables from a list of objects of the same type

Description

Select variables from a list of objects of the same type

Usage

selectFromList(x, select)

Arguments

x

A list of objects of the same type.

select

A character vector of names of variables to select.

Examples


x <- list(
  a = list(name = "John", age = 25, gender = "M"),
  b = list(name = "Mary", age = 24, gender = "F")
)
selectFromList(x, c("name", "age"))

# $a
# $a$name
# [1] "John"
#
# $a$age
# [1] 25
#
#
# $b
# $b$name
# [1] "Mary"
#
# $b$age
# [1] 24

ParallelLogger documentation built on Aug. 22, 2023, 5:11 p.m.