mdexpr: Generate an mdexpr object.

View source: R/classes.R

mdexprR Documentation

Generate an mdexpr object.

Description

Generates an mdexpression object which bundles an R expression with its evaluation result and enables seamless insertion into an R markdown document.

Usage

mdexpr(x, ref_name = NULL, caption = NULL, ...)

as_mdexpr(x, ...)

## Default S3 method:
as_mdexpr(x, ...)

Arguments

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.

Details

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 '-'.

Value

an object of mdexpr class.


PiotrTymoszuk/figur documentation built on July 16, 2024, 1:15 a.m.