Closed renkun-ken closed 10 years ago
Consider the following syntax:
1:10 %>>% (? expr)
which prints the intermediate expression and returns x. It acts just like asking for the value of the lambda expression expr and continues piping with input x.
x
expr
A demo:
> set.seed(100) > rnorm(100) %>>% + (? mean(.)) %>>% + (? median(.)) %>>% + (? summary(.)) %>>% + plot(col="red") ? mean(.) [1] 0.002912563 ? median(.) [1] -0.0594199 ? summary(.) Min. 1st Qu. Median Mean 3rd Qu. Max. -2.272000 -0.608800 -0.059420 0.002913 0.655900 2.582000
Consider the following syntax:
which prints the intermediate expression and returns
x
. It acts just like asking for the value of the lambda expressionexpr
and continues piping with inputx
.A demo: