Pipe operator choice in documentation #55
|
Since the Get Started page starts with a reference to R for Data Science (which features the base pipe operator), I thought it might make sense for the package documentation to use the base pipe ( |
Replies: 4 comments
|
I think in most cases the base pipe should work equally well. However, reading a little bit about the differences, there might be some issues. In the package code I use the In the documentation, there is at least one example that uses a functional sequences and would thus not work with the base pipe: In principle, I am not opposed to switching to the base pipe. However, there would be some adjustments needed. Just for me to understand. What are the arguments for switching? Is it just for consistency? Is it a tribute to base R? |
|
The base pipe works without loading the magrittr package. We have a little comparison box at the end of https://r4ds.hadley.nz/data-transform.html#sec-the-pipe in R4DS, though the blog post you linked to is more extensive. I don't think this is a crucial change, but I thought I'd point it out since we made the switch in R4DS and most analysis and package documentation code I see nowadays (that are newly developed) use the base pipe operator. |
|
Thank you for pointing that out! Dropping magrittr as a dependency is certainly tempting, and staying up-to-date is always a good idea ;) I’ll open this as an issue and take a closer look when I have the time. |
|
I just completely switched to the base pipe, both in the documentation and internally. |
I just completely switched to the base pipe, both in the documentation and internally.
Thanks again for your great suggestion!