
Last chance! 50% off unlimited learning
Sale ends in
extractSubList(xs, element, element.value, simplify = TRUE, use.names = TRUE)
list
]
A list of named lists.character
]
Name of element(s) to extract from the list elements of xs
.
What happens is this: x$el1$el2....
.vapply
is used and this argument is passed to FUN.VALUE
.
Note that even for repeated indexing (if length(element) > 1) you only
pass one value here which refers to the data type of the final result.logical(1)
]
If TRUE
and xs
is named, the result is named as xs
,
otherwise the result is unnamed.
Default is TRUE
.list
| simplified vector
| matrix
]. See above.
xs = list(list(a = 1, b = 2), list(a = 5, b = 7))
extractSubList(xs, "a")
extractSubList(xs, "a", simplify = FALSE)
Run the code above in your browser using DataLab