In ordinary cases where the Pipe object is directly printed out, the whole chain is evaluated immediately.
> Pipe(rnorm(100))$plot(col="red")
If the Pipe object is assigned to a symbol, for example,
> p <- Pipe(rnorm(100))$plot(col="red")
the chain of commands is not evaluated until p is printed or explicit evaluated like
> p
... some plot is produced ...
This lazy-evaluation feature of Pipe allows continuation of piping without evaluation. Consider working with ggvis.
> p <- Pipe(mtcars)$ggvis(~ mpg, ~ wt)
> p$layer_points()
$value : ggvis
... a scatter plot is produced ...
> p$layer_bars()
$value : ggvis
... a bar plot is produced ...
Pipe is lazily evaluated.
In ordinary cases where the Pipe object is directly printed out, the whole chain is evaluated immediately.
If the Pipe object is assigned to a symbol, for example,
the chain of commands is not evaluated until
p
is printed or explicit evaluated likeThis lazy-evaluation feature of Pipe allows continuation of piping without evaluation. Consider working with ggvis.