Skip to contents

Render an R Markdown file, and use the rendered YAML front matter to construct a dynamic output file name. A thin wrapper for render() followed by rename_rendered(), that also prints a helpful message for interactive use.

Usage

render_and_rename(input, callback, ..., quiet = FALSE)

Arguments

input

The input file to be rendered. This can be an R script (.R), an R Markdown document (.Rmd), or a plain markdown document.

callback

A function that gets the rendered R Markdown YAML front matter metadata as an argument, and returns a new name for file. Any changes implied to the directory or file extension are ignored -- only the name is changed.

...

Arguments passed on to render

quiet

An option to suppress printing during rendering from knitr, pandoc command line and others. To only suppress printing of the last "Output created: " message, you can set rmarkdown.render.message to FALSE

See also

renaming_renderer() for easy use in the knit front matter field.

render() and rename_rendered(), which this function wraps.