split_pipeline
takes an expression of a pipeline and splits it into a list
of unevaluated calls.
split_pipeline(pipeline, ...)
pipeline | A pipeline. Can be an unquoted or quoted expression, or a character vector of code. If missing, uses the text highlighted in RStudio's source editor. |
---|---|
... | Only used to allow assignment with |
A list of unevaluated calls extracted from the pipeline.
split_pipeline
does not split nested pipelines.
The unexported magrittr:::split_chain
,
does not handle assignment, but collects the particular pipes used.
burst_pipes
invisibly returns a restructured split pipeline.
# \donttest{ library(magrittr) split_pipeline( quote(x <- 1:5 %>% rev %>% {. * 2} %>% sample(replace = TRUE)) )#> [[1]] #> x <- 1:5 #> #> [[2]] #> rev #> #> [[3]] #> { #> . * 2 #> } #> #> [[4]] #> sample(replace = TRUE) #># }