Inserts tidyverse pipelines or generated code directly into the user's active
document buffer at the current cursor location via rstudioapi::insertText().
If RStudio is unavailable, running headless, or if no document is currently open,
falls back gracefully by returning a structured status list containing the code.
Arguments
- code
Character vector or scalar string containing the code to insert. Multiple elements are joined by newline characters.
- location
Optional cursor position or range for
rstudioapi::insertText(). Defaults toNULL(current selection/cursor).- ...
Additional arguments passed to
rstudioapi::insertText().
