Parse the R code in the RStudio editor, identify %>%, and substitute with |>.

tidy_pipe()

Note

Currently this function only works inside the RStudio IDE, and may be extended in future to deal with arbitrary R code elsewhere.

Examples

if (FALSE) { # interactive()
formatR::tidy_pipe()
}