purrr icon indicating copy to clipboard operation
purrr copied to clipboard

ikeep: analogous to imap, make .y available to predicate function

Open torbjorn opened this issue 3 years ago • 0 comments

Would it be feasible to also have an ikeep, that would be to keep what imap is to map.


my_numbers <- structure( 1:26, .Names=letters )

my_numbers %>% ikeep( ~ .x > 20 | .y %in% c("a","b","c") )

torbjorn avatar Dec 22 '21 12:12 torbjorn