Learn R Programming

rmarkdown (version 2.3)

find_pandoc: Find the pandoc executable

Description

Searches for the pandoc executable in a few places and use the highest version found, unless a specific version is requested.

Usage

find_pandoc(cache = TRUE, dir = NULL, version = NULL)

Arguments

cache

Whether to search for pandoc again if a Pandoc directory containing the pandoc executable of the expected version (if provided) has been found previously. Search again if cache = FALSE.

dir

A character vector of potential directory paths under which pandoc may be found. If not provided, this function searches for pandoc from the environment variable RSTUDIO_PANDOC (the RStudio IDE will set this variable to the directory of Pandoc bundled with the IDE), the environment variable PATH, and the directory ~/opt/pandoc/.

version

The version of Pandoc to look for (e.g., "2.9.2.1"). If not provided, this function searches for the highest version under the potential directories.

Value

A list containing the directory and version of Pandoc (if found).

Examples

Run this code
# NOT RUN {
rmarkdown::find_pandoc()
rmarkdown::find_pandoc(dir = '~/Downloads/Pandoc')
rmarkdown::find_pandoc(version = '2.7.3')
# }

Run the code above in your browser using DataLab