Skip to contents

This function updates the YAML content of a given Rmd file. YAML content is passed as a list via the dots argument of the function.

Usage

change_yaml_matter(input_file, ..., output_file)

Arguments

input_file

Input .Rmd file with YAML to be updated

output_file

Output .Rmd filename with updated YAML (optional; if left blank, updated .Rmd file will be printed in the console.)

Value

A .Rmd file with updated YAML content, either saved to the output_file path location or printed in the console.

References

Code from: https://stackoverflow.com/a/66908611/1454785