get_broken_chain | R Documentation |
This interface is intended for developers who want to hook into the chain breaking algorithm to create bindings in other text editors.
get_broken_chain(doc_lines, doc_cursor_line)
doc_lines |
a character vector of R code, one element per line. |
doc_cursor_line |
a number representing the line the cursor is on. |
Given a character vector of R code lines, and the line number of the cursor, it returns a character vector of R code lines which is the start of the chained expression the cursor is on, up to the cursor line.
Any assignment with <-
or =
at the head of the chain is removed.
a character vector of R code representing the broken chain.
get_broken_chain( c( "species_scatter <- starwars %>%", "group_by(species, sex) %>%", "select(height, mass)", " .99s.scatter <- starwars %>%", "group_by(species, sex) %>%", "select(height, mass)" ), 3 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.