tar_knitr_deps_expr: Expression with literate programming dependencies.

View source: R/tar_knitr_deps_expr.R

tar_knitr_deps_exprR Documentation

Expression with literate programming dependencies.

Description

Construct an expression whose global variable dependencies are the target dependencies of one or more literate programming reports (R Markdown or knitr). This helps third-party developers create their own third-party target factories for literate programming targets (similar to tar_knit() and tar_render()).

Usage

tar_knitr_deps_expr(path)

Arguments

path

Character vector, path to one or more R Markdown or knitr reports.

Value

Expression object to name the dependency targets of the knitr report, which will be detected in the static code analysis of targets.

See Also

Other Literate programming utilities: tar_knitr_deps(), tar_quarto_files()

Examples

lines <- c(
  "---",
  "title: report",
  "output_format: html_document",
  "---",
  "",
  "```{r}",
  "targets::tar_load(data1)",
  "targets::tar_read(data2)",
  "```"
)
report <- tempfile()
writeLines(lines, report)
tar_knitr_deps_expr(report)

tarchetypes documentation built on Dec. 1, 2022, 1:31 a.m.