John Mount explains the benefit of pipes and pipelines, and shows us an advanced pipe in R:
The idea is: many important calculations can be considered as a sequence of transforms applied to a data set. Each step may be a function taking many arguments. It is often the case that only one of each function’s arguments is primary, and the rest are parameters. For data science applications this is particularly common, so having convenient pipeline notation can be a plus. An example of a non-trivial data processing pipeline can be found here.
In this note we will discuss the advanced
R
pipeline operator “dot arrow pipe” and anS4
class (wrapr::UnaryFn
) that makes working with pipeline notation much more powerful and much easier.
As you’d expect from John, there’s a lot of detail and it’s an interesting approach.