Description Usage Arguments Value Examples
View source: R/collapse_pipe.R
When parsing lines of code this will collapse piped lines into a single one
1 | collapse_pipe(pattern = "%[[:punct:]]%|[+]", x, comment_tokens = NULL)
|
pattern |
character, symbols to collapse on Default: '%[[:punct:]]%|[+]' |
x |
character, lines of script to run on |
comment_tokens |
character, tokens to comment out collapsed lines e.g. 'plot', 'print' Default: NULL |
character
1 2 3 4 5 6 7 8 | ## Not run:
str1<-'iris%>%
dplyr::mutate(Sepal.Length*2)%>%
plot()'
x<-strsplit(str1,'\\n')[[1]]
collapse_pipe(x=x,comment_tokens = 'plot')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.