I found the function below here. It works great, but I would like to dynamically name the output file 'analysis.docx', using the title of the document, the author and the current date.
title: thetitle
author: myinititals
date: "`r Sys.Date()`"
knit: (function(inputFile, encoding) {
out_dir <- 'test';
rmarkdown::render(inputFile,
encoding=encoding,
output_file=file.path(dirname(inputFile), out_dir, 'analysis.docx')) })
How do I make 'analysis.docx' dynamic in this case?
I found some more information here, but not my desired answer.