Learn R Programming

devtoolbox (version 0.2.0)

run_rmd: Run RMarkdown Report based on an existing RMarkdown file

Description

This is a support function that accepts parameters and creates a HTML document based on an RMarkdown template. This function is taken from the generate_report2() function from the 'wpa' package.

Usage

run_rmd(
  output_format = rmarkdown::html_document(toc = TRUE, toc_depth = 6, theme = "cosmo"),
  output_file = "report.html",
  output_dir = getwd(),
  report_title = "Report",
  rmd_dir = system.file("rmd_template/minimal.rmd", package = "devtoolbox"),
  ...
)

Value

Opens and saves a static HTML report in the active directory, using the RMarkdown template as specified in the argument rmd_dir.

Arguments

output_format

output format in rmarkdown::render(). Default is rmarkdown::html_document(toc = TRUE, toc_depth = 6, theme = "cosmo").

output_file

output file name in rmarkdown::render(). Default is "report.html".

output_dir

output directory for report in rmarkdown::render(). Default is user's current directory.

report_title

report title. Default is "Report".

rmd_dir

string specifying the path to the directory containing the RMarkdown template files. This uses the internal minimal template by default.

...

other arguments to be passed to params.

Running the report

You can run the minimal report and pass arguments directly to run_rmd:

run_rmd(pkgname = "devtoolbox")