Skip to contents

Copies a file using fs::file_copy() and changes the output type in the yaml front matter from html_notebook to html_document, removing all other output types.

Usage

to_document(file_path, new_path, overwrite = FALSE)

Arguments

file_path

Path to the source file

new_path

Path to copy the converted file using fs::file_copy()

overwrite

Overwrite file if it exists, passed to fs::file_copy()

Value

Path to new file

Examples

if (FALSE) { # \dontrun{
to_document("notebook.Rmd", "document.Rmd")
to_document("notebooks_dir/notebook.Rmd", "documents_dir")
} # }