mdexpr | R Documentation |
Generates an mdexpression object which bundles an R expression with its evaluation result and enables seamless insertion into an R markdown document.
mdexpr(x, ref_name = NULL, caption = NULL, ...)
as_mdexpr(x, ...)
## Default S3 method:
as_mdexpr(x, ...)
x |
an expression. |
ref_name |
name of the reference to the code block, used mainly in markdown documents (waiting for a bookdown implementation). |
caption |
text to be presented in the code chunk caption, currently no implementation in bookdown (https://github.com/rstudio/bookdown/issues/238) |
... |
extra arguments, currently none. |
Throws any errors and warnings encountered during the evaluation. In addition checks if the result is NULL, NA or Inf and raises a warning if this is the case. You may easily insert the read-to-use R code chunk stored in the mdexpr object into your Rmarkdown document with the 'insert()' or 'refer()' method.
ref_name: needs to be a valid markdown/bookdown reference name. By default, spaces, slashes and underscores are silently turned into '-'.
an object of mdexpr class.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.