yes it was added in 4.1
> letters |> toupper() |> tail()
[1] "U" "V" "W" "X" "Y" "Z"
it only pipes into the first argument position
1
1
the piping is undone immediately (during parsing or thereabouts). you can't even quote the code
quote(letters |> toupper() |> tail())
#> tail(toupper(letters))
so it has a performance advantage over magrittr pipe
1
Yes, its an in-parser transformation. And there is a performance benefit, but the primary benefit is in debugability, since with the native pipe (which is what '|>' is called in #rstats) you get a completely normal callstack.
1
1
3
And the best part, by a mile, is what @groundwalkergmb mentioned: internally it just plain regular code:
> deparse(substitute(letters |> toupper() |> tail()))
[1] "tail(toupper(letters))"
>
1
1
Or if you *really* want to drive the point home:
> letters |> toupper() |> tail() |> substitute() |> deparse()
[1] "tail(toupper(letters))"
>
Sep 9, 2021 路 9:36 PM UTC
1


