R/fastverse.R
getelem.Rd
Get named element from list
getelem(l, nm)
named <list>
<list>
<character> element name; can be a regex pattern
<character>
named <list> element
list(x1 = NA, x2 = "AA") |> getelem("x2") #> [1] "AA" list(x1 = NA, x2 = "AA") |> getelem("2$") #> [1] "AA"