for what is worth, the placeholder for base pipe "_" is enouth most of the time
```mtcars |> lm(mpg ~ hp, data = _)
```
(cannot be chained though and the argument -here data- needs to be a named argument)
For some reason, it never works for me haha π and AFAIK you can use it only once, which (with named argument) are big limitations for me. It's a pity it doesn't work as well as %>%, but I guess there is a reason for that:)
From some youtube video with Luke Tierney from R Core, iirc the reason has something to do with not requiring lot of changes to the R parser and meaningful error stack traces. There is probably some slides about this https://stat.ethz.ch/pipermail/r-devel/2020-December/080279.html
I have never tried switching before (but thought about it), and your post has successfully convinced me to never switch to base pipe, congratulations π
If R had a better syntax for anonymous functions than that squiggly line monstrosity, I would use base pipe more. But (/{]β\Β£]{() is so unreadable that it outweighs any benefit of the base pipe.
if it helps, and it won't because i know you, but this is how i remember it: \() is meant to evoke a lambda like Ξ»() and "lambda" is another name for an anonymous function
Comments
```mtcars |> lm(mpg ~ hp, data = _)
```
(cannot be chained though and the argument -here data- needs to be a named argument)
Sticking to Magrittr for now.
mtcars |> (\(x) plot(x$wt, x$mpg))()
would much rather do
invoke <- function(x, f, ...) f(x, ...)
mtcars |> invoke(function(x) plot(x$wt, x$mpg))
or with https://do.call() or purrr::invoke()