loading...

Pass first argument as dot to run code in second argument for pipe operators that do not natively support dot-replacement scheme (base R pipe operator)

._(x, expr)

Arguments

x

Object to pass to expr as dot (.).

expr

Expression to execute, containing . as a placeholder.

Value

The result from executing expr in the parent environment.

Details

The function has a side-effect to assign x as . and unevaluated expr as .call in the calling environment. Therefore, make sure you do not use . or .call there for something else. In case expr fails in the middle of a series of chained pipes, you can inspect . and .call or possibly rerun a modified version of the instruction that failed on it for easier debugging purpose.

Examples