get_list_path: Retrieve an object from a list using path-style targeting

Description Usage Arguments Value Examples

View source: R/util.R

Description

Retrieve an object from a list using path-style targeting

Usage

1
get_list_path(l, target)

Arguments

l

a list object

target

a character object specifying the "path" to the target.

Value

a list object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
l <- list(forest = list(country = "USA",
                        maple = list(height = 100)))

maple_height <- get_list_path(l,
                              target = "/forest/maple/height")

forest_list <- get_list_path(l,
                             target = "/forest")

forest_country <- get_list_path(l,
                                target = "/forest/country")

AllenInstitute/BarMixer documentation built on Dec. 17, 2021, 8:42 a.m.