In R 4.1 (May 2021) a native pipe operator was introduced that is “more streamlined” than previous implementations. I already noticed one difference between the native |>
and the magrittr pipe %>%
, namely 2 %>% sqrt
works but 2 |> sqrt
doesn’t and has to be written as 2 |> sqrt()
. Are there more differences and pitfalls to be aware of when using the native pipe operator?
Have you checked out the
?pipeOp
and the?"%>%"
hep pages? That’s a good source of info.official tidyverse blog post on the topic: tidyverse.org/blog/2023/04/base-vs-magrittr-pipe