Learn R Programming

trackr (version 0.10.7)

knit_and_record: Knit and record an Rmd, Rnw, etc file

Description

This function wraps knitr's knit function in a way that captures and records some or all values generated by code within the report, as well as the report itself.

This means that many records will generally be added to the trackr db for a single call to this function.

Usage

knit_and_record(
  input,
  ...,
  verbose = FALSE,
  tmptdb = TrackrDB(backend = ListBackend(), img_dir = img_dir(defaultTDB())),
  recvars = NULL,
  dryrun = FALSE
)

Arguments

input

The input argument exactly as knitr's knit function accepts it

...

Passed directly to knit

verbose

passed to (multiple) record calls for report and its outputs

tmptdb

A TrackrDB in which to temporarily record results which are printed within the dynamic document. Generally this should not need to be changed, as it is only used to collect the records so they can be associated with the result for the whole document (in the defaultTDB).

recvars

character or NULL. The names of variables generated by the code within input which should be automatically recorded, or NULL.

dryrun

logical. Should a dryrun be performed?

Details

When recvars is NULL, any objects which are visibly printed within the report are also recorded. Otherwise, only the values of the listed variables (after all code has been evaluated) are recorded, regardless of visibility