break_chain | R Documentation |
Run a chain of piped or otherwise infixed commands up to and including the cursor line. The chain is assumed to end each line with the chaining operator, as is common in ' the tidyverse style guide.
When a chain begins with an assignment via =
or <-
the assignment is
not performed. Results of running the chain section are printed to the
console, and by default stored in a global variable called .chain
.
break_chain( print_result = TRUE, assign_result = getOption("breakerofchains_store_result", TRUE) )
print_result |
Enable/disable printing of chain evaluation result in console. Useful when wrapping this function to display results in a custom way. |
assign_result |
assign the result of chain evaluation to |
Storing results in .chain
can be disabled by setting
options(breakerofchains_store_result = FALSE)
.
Your code is read via the rstudioapi in RStudio or rstudioapi emulation in VSCode. Code is parsed up to the cursor line before an algorithm works backwards to find the chain start. Unfortunately this means all code above the cursor line must be valid parsable R code.
It is unlikely you want to run this function directly. You probably want to bind it to a keyboard shortcut. See README for more information.
Developers: You can create addins / shortcuts that treat the result of chain evaluation differently
by wrapping this function. e.g. view(break_chain())
The parameters of this
function are inteded to be useful for this e.g.
view(break_chain(print_result = FALSE))
the result of chain execution invisibly
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.