Does a multi-value purrr::pluck exist?

前端 未结 4 788
既然无缘
既然无缘 2021-02-19 11:49

Seems like a basic question and perhaps I\'m just missing something obvious ... but is there any way to pluck a sublist (with purrr)? More specifically

4条回答
  •  忘了有多久
    2021-02-19 12:22

    I think that purrr::keep() does what you want.

    l %>% keep(names(.) == "a" | names(.) == "b")

提交回复
热议问题