purrr 1.0.0

This is a companion discussion topic for the original entry at https://www.tidyverse.org/blog/2022/12/purrr-1-0-0

This is great; as always, thanks to the Posit team for such great tools!

One question that I have on which it might be useful for the community to have some future-plans insight is: does {purrr}'s transition to the new {base}/native pipe (|>) hint at a larger tidyverse migration away from {magrittr}'s pipes? If so, what were the key arguments for/against each in the conversations giving rise to that decision? Speaking for myself, I've continued to use {magrittr}'s pipes, in part because of consistency with the other pipe variants (particularly the T-pipe (%T>%)). And if there is a larger-planned migration to |> throughout the tidyverse, perhaps a migration-guide for tidyverse users would be of use?

1 Like

Hadley discusses this a bit in the blog post,

As you’ve seen in the code above, we are moving from magrittr’s pipe (%>% ) to the base pipe (|> ) and from formula syntax (~ .x + 1 ) to R’s new anonymous function short hand (\(x) x + 1 ). We believe that it’s better to use these new base tools because they work everywhere: the base pipe doesn’t require that you load magrittr and the new function shorthand works everywhere, not just in purrr functions.

Yup, it's actually that post the prompted my question. While true that {purrr} is moving to the base pipe, I'm wondering if this is a larger decision that will affect the rest of {tidyverse}, {tidymodels}, etc., since the two pipes are not completely equivalent.

Knowing about such plans is especially useful when preparing teaching materials for new R students: I envision mixed pipe types as being an unfortunate point of confusion, so encouraging the move to the base pipe would be great ... but only if the {tidyverse}, {tidymodels}, etc. world is also planning to work seamlessly with the base pipe, too.

Thank you.
Is there a recommended purrr tutorial please?

I like the iteration chapter in R4DS,

Belated thank you. I am going to try and convert my use dplyr to use purrr and see differences/advantages

1 Like

As map_dfr will be superseded then should be map_tibble/map_dataframe variant which would ensure that return values are proper type (i.e. tibbles/data.frames). Cause now check will be on list_rbind.

This topic was automatically closed after 59 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.