View source: R/reprex_document.R
reprex_document | R Documentation |
This is an R Markdown output format designed specifically for making
"reprexes", typically created via the reprex()
function, which ultimately
renders the document with reprex_render()
. It is a heavily modified version
of rmarkdown::md_document()
. The arguments have different spheres of
influence:
venue
potentially affects input preparation and reprex_render()
.
Add content to the primary input, prior to rendering:
advertise
session_info
std_out_err
(also consulted by reprex_render()
)
Influence knitr package or chunk options:
style
comment
tidyverse_quiet
RStudio users can create new R Markdown documents with the
reprex_document()
format using built-in templates. Do
File > New File > R Markdown ... > From Template and choose one of:
reprex (minimal)
reprex (lots of features)
Both include knit: reprex::reprex_render
in the YAML, which causes the
RStudio "Knit" button to use reprex_render()
. If you render these documents
yourself, you should do same.
reprex_document(
venue = c("gh", "r", "rtf", "html", "slack", "so", "ds"),
advertise = NULL,
session_info = opt(FALSE),
style = opt(FALSE),
comment = opt("#>"),
tidyverse_quiet = opt(TRUE),
std_out_err = opt(FALSE),
pandoc_args = NULL
)
venue |
Character. Must be one of the following (case insensitive):
|
advertise |
Logical. Whether to include a footer that describes when and
how the reprex was created. If unspecified, the option |
session_info |
Logical. Whether to include
|
style |
Logical. Whether to set the knitr chunk option |
comment |
Character. Prefix with which to comment out output, defaults
to |
tidyverse_quiet |
Logical. Sets the options |
std_out_err |
Logical. Whether to append a section for output sent to
stdout and stderr by the reprex rendering process. This can be necessary to
reveal output if the reprex spawns child processes or |
pandoc_args |
Additional command line options to pass to pandoc |
An R Markdown output format to pass to rmarkdown::render()
.
reprex_document()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.