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

Description Usage Arguments Details Note

View source: R/knitr.R

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

1
2
3
4
5
6
7
8
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

Note

as with all knitr support in the histry and trackr packages, manually tracing certain functions within the knitr and evaluate packages will break this function.


gmbecker/recordr documentation built on May 24, 2021, 10:59 a.m.