myKnit: Custom 'knit' button for RMarkdown to support colating...

View source: R/myKnit.R

myKnitR Documentation

Custom 'knit' button for RMarkdown to support colating multiple YAML header files before prepending to RMarkdown document

Description

This funtion can be called from within the YAML header of the RMarkdown document to pull in multiple YAML source files so that common YAML definitions can be shared amoung documents.

Usage

myKnit(
  inputFile,
  encoding,
  output_dir = output_dir,
  yamlFiles = c("common.yaml", "name.yaml")
)

Arguments

inputFile

The file name of the RMarkdown file

encoding

The 'encoding' argument for 'rmarkdown::render()'

output_dir

Character vector of length one having the directory destination for the output file.

yamlFiles

Character vector of relative file paths to YAML files to be used

Details

This function was adapted from the first answer, option 2 provided at https://stackoverflow.com/questions/39885363/importing-common-yaml-in-rstudio-knitr-document/39909079#39909079?newreg=1ab151a7b48b450589dce8595951a3b7 by stackoverflow user:913184 ( https://stackoverflow.com/users/913184/mathematical-coffee)


rmsharp/rmsutilityr documentation built on Feb. 13, 2024, 6:01 p.m.