bind-result: Safely pipe values through a chain of functions, avoiding...

Description Usage Arguments Details Value

Description

The bind operator for an object of class "result" executes the function or block on the right-hand side if the object contains a value, or passes on the error it contains if not. If the right-hand side function would raise an error, that error is captured in the returned value instead. To turn a regular R object into a result (or vice-versa) see result.

Usage

1
2
## S3 method for class 'result'
lhs %>>=% rhs

Arguments

lhs

An object of class "result".

rhs

A function or block, evaluated with . bound to the value of lhs, or ignored if there is no value in lhs.

Details

The right-hand side syntax is largely identical to that of the pipe operator, %>%.

Value

An object of class "result" wrapping the output of the rhs function or block, or carrying forward its error if it has one.


atheriel/rrails documentation built on May 4, 2019, 1:07 p.m.