inst/doc/dot_pipe.R

## ----pipe1s-------------------------------------------------------------------
library("wrapr")

cos(exp(sin(4)))

4 %.>% sin(.) %.>% exp(.) %.>% cos(.)

## ----pipe1--------------------------------------------------------------------
1:4 %.>% .^2 

## ----pipe2--------------------------------------------------------------------
5 %.>% sin(.)

5 %.>% base::sin(.)

## ----peager-------------------------------------------------------------------
f <- function() { sin }

# returns f() ignoring dot, not what we want
5 %.>% f()

# evaluates f() early then evaluates result with .-substitution rules
5 %.>% .(f())

Try the wrapr package in your browser

Any scripts or data that you put into this service are public.

wrapr documentation built on Aug. 20, 2023, 1:08 a.m.