Hello,
The experimental (undocumented?) pipe bind operator (=>) was introduced in
January 2021 (https://stat.ethz.ch/pipermail/r-devel/2021-January/080396.html).
In December 2021, Luke Tierney said that it might be dropped
(https://stat.ethz.ch/pipermail/r-devel/2021-December/081384.html).
It is still present in R-devel (to become R 4.6):
mtcars |> (\(x) lm(mpg ~ disp, data = x))()
mtcars$mpg |> quantile() |> (\(x) sprintf("%.1f (%.1f, %.1f)", x[3], x[2],
x[4]))()
Sys.setenv("_R_USE_PIPEBIND_" = TRUE)
mtcars |> x => lm(mpg ~ disp, data = x)
mtcars$mpg |> quantile() |> x => sprintf("%.1f (%.1f, %.1f)", x[3], x[2], x[4])
Since a few years have passed, are there now any plans regarding the pipe bind
operator?
I still hope it will be officially supported, as I find it a very readable
alternative to anonymous functions in pipe chains (for cases where the
placeholder is not supported). It might be easily adopted, since similar syntax
exists in other widely used languages (e.g., arrow functions in ES6/JS).
Best,
Thomas
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel