Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
renkun-ken committed Aug 5, 2014
1 parent 90cc286 commit 4ac624f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,22 @@ devtools::install_github("pipeR","renkun-ken")

## Usage

### `%>>%`

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

- `foo` or `foo(...)`: Pipe to its first argument;
- `{ expression }` or `( expression )`: Pipe to symbol `.`;
- `(x -> expression)` or `(x ~ expression)`: Pipe to symbol `x`.
- `{ expr }` or `( expr )`: Pipe to symbol `.`;
- `(x -> expr)` or `(x ~ expr)`: Pipe to symbol `x`.

### `Pipe()`

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

- `Pipe(x)$foo()$bar()`: Pipe along a chain of function calls and get a `Pipe` object for further chaining;
- `Pipe(x)$foo()$bar() []`: Extract the final value of the `Pipe` object;
- `Pipe(x)$fun(expr)`: Pipe to `.`;
- `Pipe(x)$fun(x -> expr)` or `Pipe(x)$fun(x ~ expr)`: Pipe to `x`;

## Examples

Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,22 @@ devtools::install_github("pipeR","renkun-ken")

## Usage

### `%>>%`

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

- `foo` or `foo(...)`: Pipe to its first argument;
- `{ expression }` or `( expression )`: Pipe to symbol `.`;
- `(x -> expression)` or `(x ~ expression)`: Pipe to symbol `x`.
- `{ expr }` or `( expr )`: Pipe to symbol `.`;
- `(x -> expr)` or `(x ~ expr)`: Pipe to symbol `x`.

### `Pipe()`

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

- `Pipe(x)$foo()$bar()`: Pipe along a chain of function calls and get a `Pipe` object for further chaining;
- `Pipe(x)$foo()$bar() []`: Extract the final value of the `Pipe` object;
- `Pipe(x)$fun(expr)`: Pipe to `.`;
- `Pipe(x)$fun(x -> expr)` or `Pipe(x)$fun(x ~ expr)`: Pipe to `x`;

## Examples

Expand Down

0 comments on commit 4ac624f

Please sign in to comment.