I'm working with a long named list and I'm trying to keep/remove elements that match a certain name, within a tidyverse context, similar to
dplyr::select(contains("pattern"))
However, I'm having issues figuring it out.
library(tidyverse)
a_list <-
list(a = "asdfg",
b = "qwerty",
c = "zxcvb")
a_list %>% pluck("a") # works
a_list %>% pluck(contains("a")) #does not work
a_list[2:3] # this is what I want
a_list %>% pluck(-"a") # but this does not work