-
Notifications
You must be signed in to change notification settings - Fork 292
Description
I find the interface of invoke() a bit weird to use. I'd find it much more natural if both invoke() and invoke_map() received .x as first argument. It's generally this argument that gets manipulated in a
pipeline and I think .f does not have a different status than in other mapping tools.
Also, I'm still bugged about this:
a <- mtcars %>% map_n(paste)
b <- mtcars %>% transpose %>% invoke_map("paste", .x = .)
identical(a, b)
#> TRUEThe more I think about it, the more I feel map_n() has a different structure than map() and map2(). To me, it feels more like a variant of invoke().
Would it make sense to rename map_n() to invoke_zip() or invoke_map_t()? The zip suffix could be interpreted in purrr as mapping a transpose. Also we'd rename map_rows() to invoke_rows() (the transpose operation being implicit in choosing the rows, we don't need a t or zip particle here).