arsenal (version 2.0.0)

write2.internal: Helper functions for write2

Description

Helper functions for write2.

Usage

# S3 method for verbatim
print(x, ...)

verbatim(x)

code.chunk(..., chunk.opts = "r")

# S3 method for code.chunk print(x, ...)

Arguments

x

An R object to coerce to class "verbatim" or such an object to print.

...

For print.verbatim, other arguments passed to print. For code.chunk, either expressions or single character strings to paste into the code chunk. Not used for print.code.chunk.

chunk.opts

A single character string giving the code chunk options. Make sure to specify the engine!

Details

The "verbatim" class is to tell write2 to print the object inside a section surrounded by three back ticks. The results will look like it would in the terminal (monospaced).

code.chunk() is to write explicit code chunks in the .Rmd file; it captures the call and writes it to the file, to execute upon knitting.