title: R Markdown / knitr: specify path for all input, temporary, and output files
body: <p>I am trying to get R Markdown and knitr to work on a linux server with restricted access. In particular: specific file types have to go into specific folders and creating new folders is impossible. Deleting files is also not possible (but overwriting is). R Markdown and knitr seem to want to create a range of files and folders with limited control where what goes. There seems to be some way to make specifications on a chunk by chunk basis, but this would not work without a lot of user training. Is it possible to specify separate paths for all the inputs and outputs, including:</p>
  
  <ul>
  <li>Input document (could be set using rmarkdown::render())</li>
  <li>Figures created by the chunks (cannot be set using rmarkdown::render())</li>
  <li>*.md, *.tex, *.aux and other intermediary files (could be set using rmarkdown::render())</li>
  <li>*.log files (cannot be set using rmarkdown::render())</li>
  <li>Final output file (e.g. PDF) (could be set using rmarkdown::render())</li>
  </ul>
  
  <p>Ideally the solution should work both for R Studio and basic R, but partial solutions are welcome.</p>