This seems like a basic question (almost embarrassingly-so) and perhaps I'm just missing something obvious ... but is there any way to pluck a sublist with purrr?
More specifically, here's an initial list:
l <- list(a = "foo", b = "bar", c = "baz")
And I want to return a new (sub-)list with elements a and b.
Normally, I'd just do 'base' R sub-listing:
l[c("a", "b")]
But this doesn't provide the nice .default handling of pluck which I've really come to appreciate.
Pluck (more-or-less) 'replaces' [[, but is there a purrr equivalent for replacing [?
(I know I can create a moral equivalent using various map* functions, as well as simply pluck-ing twice (in the above example), but I just want to make sure that I'm not overlooking an already-in-place function/pattern for this!)