I would like to be able to create a folder to store my Markdown document in from within R Markdown.
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'))
})
The problem is that it only works if the folder already exists. Is there a way to initialise a folder from within Rmarkdown.