Learn R Programming

jwutil (version 1.2.1)

source_purl: Extract code from knitr vignette and source it

Description

Extract code from knitr vignette and source it. This has the advantage in that it runs with code in R session, whereas running vignettes normally requires the package to be installed.

Usage

source_purl(input, output = file.path(.tempdir(), paste0(basename(input),
  ".R")), documentation = 1L, ...)

Arguments

input

path to file as single character string

output

output file path, defaults to a file in a temporary name based on input

documentation

single integer value passed on to knitr::purl. An integer specifying the level of documentation to go the tangled script: 0 means pure code (discard all text chunks); 1 (default) means add the chunk headers to code; 2 means add all text chunks to code as roxygen comments

...

further parameters passed to source