An R program is generated with the name of path sans extension, appended with "-render.R". This contains a header and a call to rmarkdown::render or quarto::quarto_render. This program is then executed from its directory and the output file is optionally opened.

The generated R program is not modified if it already exists, but the program is examined to confirm it calls rmarkdown::render or rmarkdown::render.

render(path = NULL, open = rstudioapi::isAvailable(), as_job = FALSE)

Arguments

path

file path of R Markdown document, Quarto document or R script. Defaults to the path of the source editor context.

open

logical indicating whether to open the output file.

as_job

logical indicating whether to execute as an RStudio job.

Value

logical indicating whether the document was successfully rendered.

Examples

if (FALSE) { # \dontrun{
render("markdown_doc.Rmd")
} # }