Quote a chain of (abritrary number of) pipes.
.pipe_between(x, ...)
x | Starting function for the pipe chain. |
---|---|
... | Subsequent functions appended to the pipe chain. |
A quoted pipe chain starting with x
to the last element of ...
,
or x
itself if ...
is empty.
if (FALSE) { # Creating pipe chain .pipe_between(2, runif()) #> 2 %>% runif() # Evaluating pipe chain later on eval(.pipe_between(2, runif())) #> [1] 0.5180003 0.5353272 # Longer pipe chain long_chain <- .pipe_between(2, runif(), sum(), log()) long_chain #> 2 %>% runif() %>% sum() %>% log() eval(long_chain) #> [1] -0.4767814 }