Skip to content

v0.4

Compare
Choose a tag to compare
@renkun-ken renkun-ken released this 05 Aug 03:50
· 244 commits to master since this release

What's new in 0.4?

  • Major API Change: %>>% operator now handles all pipeline mechanisms and other operators are deprecated.
  • Add Pipe object that supports object-based pipeline operation.

Usage

%>>%

The form of the object following %>>% determines which piping mechanism is used. If the operator is followed by, for example,

Usage As if
x %>>% f f(x)
x %>>% f(...) f(x,...)
x %>>% { f(.) } f(x)
x %>>% ( f(.) ) f(x)
x %>>% (i -> f(i)) f(x)
x %>>% (i ~ f(i)) f(x)

Pipe()

Pipe() creates a Pipe object that supports light-weight chaining using internal operators. For example,

Usage Description
Pipe(x)$foo()$bar() Build Pipe object for chaining
Pipe(x)$foo()$bar() [] Extract the final value
Pipe(x)$fun(expr) Pipe to .
Pipe(x)$fun(x -> expr) Pipe to x
Pipe(x)$fun(x ~ expr) Pipe to x