tar_knit_run: Run a 'knitr' report inside a 'tar_knit()' target.

View source: R/tar_knit.R

tar_knit_runR Documentation

Run a knitr report inside a tar_knit() target.

Description

Internal function needed for tar_knit(). Users should not invoke it directly.

Usage

tar_knit_run(path, working_directory, args, deps)

Arguments

path

Character string, file path to the knitr source file. Must have length 1.

working_directory

Optional character string, path to the working directory to temporarily set when running the report. The default is NULL, which runs the report from the current working directory at the time the pipeline is run. This default is recommended in the vast majority of cases. To use anything other than NULL, you must manually set the value of the store argument relative to the working directory in all calls to tar_read() and tar_load() in the report. Otherwise, these functions will not know where to find the data.

args

A named list of arguments to knitr::knit().

deps

An unnamed list of target dependencies of the knitr report, automatically created by tar_knit().

Value

Character with the path to the knitr source file and the relative path to the output knitr report. The output path depends on the input path argument, which has no default.


tarchetypes documentation built on Sept. 30, 2024, 9:18 a.m.