Add an rmarkdown Template

Usage

new_vignette(title = paste("Introduction to", basename(getwd())), file.name = paste0(gsub("\\s+", "_", tolower(title)), ".Rmd"), vign.path = "vignettes", add.builder = TRUE, desc.path = "DESCRIPTION", builder = "knitr")

Arguments

title
The title of the rmarkdown vignette document. Defaults to Introduction to x where x is the name of the package.
file.name
The name of the vignette file. Defaults to lower case, underscore (for space) .Rmd file that utilizes the title argument.
vign.path
The path to the vignettes directory (where the vignette will be placed).
add.builder
logical. If TRUE the builder argument will be added as the VignetteBuilder fied in the ‘DESCRIPTION’ file. Additionally, if builder = "knitr" this will be added to Suggests: field if not already a dependency.
desc.path
The path to the ‘DESCRIPTION’ file. Defaults to desc.path = "DESCRIPTION".
builder
The name of the VignetteBuilder in the ‘DESCRIPTION’ file. Defaults to builder = "knitr".

Add an <span class = "pkg">rmarkdown</span> Template

Add an <span class = "pkg">rmarkdown</span> Template

Value

Generates a ‘____.Rmd’ vignette file template.

Description

Generates an rmarkdown style template ‘.Rmd’ file and adds knitr to VignetteBuilder & Suggests fields if not already included.

Examples

## <strong>Not run</strong>: # pax("temp_dir", open = FALSE) # dir.create("temp_dir/vignettes") # ## Note: If used in RStudio with the root directory set to the # ## package the user does not need to supply `vign,path` or `desc.path` # new_vignette("intro", vign.path = "temp_dir/vignettes", # desc.path = "temp_dir/DESCRIPTION") # unlink("temp_dir", TRUE, TRUE) # ## <strong>End(Not run)</strong>