Closed shearerpmm closed 1 year ago
using x %>% keep_at(grepl("^c", names(.)))?
using x %>% keep_at(grepl("^c", names(.)))?
you don't need the names()
in there because the function in at
in keep_at() already operates on the names of the vector.
purrr::keep_at(x, \(x) grepl("^c", x))
Or purrr::keep_at(x, \(x) startsWith(x, "c"))
😄
Now that
vars
is deprecated, what is the right way to write this code?