purrr
purrr copied to clipboard
ikeep: analogous to imap, make .y available to predicate function
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") )