Pipe()
function is the light-weight version of Pipe operator yet has more features.
%>>%
but use $
for command chainingBasically, Pipe()
creates a Pipe
object for which $
is specially defined to perform first-argument piping, and .(...)
is defined to act like x %>>% (...)
. Pipe object also supports subsetting ([]
), extraction ([[]]
), and their corresponding assignment operations.
Using Pipe()
the following code
mtcars %>>%
lm(formula = mpg ~ wt + cyl) %>>%
summary
can be rewritten like
Pipe(mtcars)$
lm(formula = mpg ~ wt + cyl)$
summary()