Using output_file is one option.
Path handling is not easy inside rmarkdown::render() so you could also do the copying yourself.
Etiher:
- Render the output where your source is & move the output where you want - all using R code
- Copy the source in your destination location & render their your output.
Sometimes this is the safest solution so that everything works fine.
Hope it helps