Skip to contents

Insert text into a document.

Usage

includeText(path, data = parent.frame(), quiet = TRUE)

Arguments

path

Path to the child document.

data

Environment or list used to knit the child document.

quiet

Passed to knitr::knit().

Value

An R object of class "knit_asis" (defined in the knitr package), the data of which represents the content of the child document (after knitr::knit())

Examples

template <- tempfile()
cat("Hello, `r name`.\n", file = template)
includeText(template, data = list(name = "Alice"))
#> [1] "Hello, Alice."
#> attr(,"class")
#> [1] "knit_asis"
#> attr(,"knit_cacheable")
#> [1] NA
file.remove(template)
#> [1] TRUE