reprex_addin() opens an RStudio gadget and
addin that allows you to say
where the reprex source is (clipboard? current selection? active file?
other file?) and to control a few other arguments. Appears as "Render
reprex" in the RStudio Addins menu.
reprex_selection() is an
addin that reprexes the current
selection, optionally customised by options. Appears as "Reprex selection"
in the RStudio Addins menu. Heavy users might want to create a keyboard shortcut.
Suggested shortcut: Cmd + Shift + R (macOS) or Ctrl + Shift + R (Windows).
reprex_selection(venue = getOption("reprex.venue", "gh"))
Character. Must be one of the following (case insensitive):
"gh" for GitHub-Flavored Markdown, the
"r" for a runnable R script, with commented output interleaved. Also useful
for Slack code snippets;
select "R" from the "Type" drop-down menu to enjoy nice syntax
Rich Text Format
(not supported for un-reprexing)
"html" for an HTML fragment suitable for inclusion in a larger HTML
document (not supported for un-reprexing)
"slack" for pasting into a Slack message. Works best if you opt out of
Slack's WYSIWYG interface and, instead, go to Preferences > Advanced
and select "Format messages with markup".
Stack Overflow Markdown.
Note: this is just an alias for "gh", since Stack Overflow started to
support CommonMark-style fenced code blocks in January 2019.
"ds" for Discourse, e.g.,
community.rstudio.com. Note: this is
currently just an alias for "gh".