Create a new RStudio project of type package. Create a vignettes directory.
Create two new R Markdown templates. One in the top level of the package (same level as DESCRIPTION
) and one in the vignettes directory. knit both to html.
The resulting html file for the first .Rmd is right next to the .Rmd, at the highest level of the package. This is the behavior I expect.
The resulting html file for the second .Rmd is, for me, placed in a temporary directory like:
/private/var/folders/mk/lh99bg295msg8myvcf5yczkc0000gn/T/RtmpDNga3D/preview-152834fe09ff.dir/Untitled.html
and not in the vignettes directory.
Is this the intended behavior? Any pointers to the appropriate documentation appreciated!
Is there an easy way to change this? I would prefer the same behavior in the vignettes directory (create the hmtl and leave it right there) that I see in the top level directory.
I am on a Mac.
Yes, this is intended. It's to keep your vignettes folder from becoming cluttered with HTML files. RStudio renders all package documentation Rmds to temporary files. If you're curious the relevant code is here:
https://github.com/rstudio/rstudio/blob/6056d36192c0a4d1381e5b4f5a3cb8594a2ce97e/src/gwt/src/org/rstudio/studio/client/workbench/views/source/editors/text/TextEditingTarget.java#L5220-L5234
There's no option to change this behavior, but it only engages when you are using RStudio's package building tools. If you want to temporarily disable it, you can go to your Project Options and change Build Tools to None (although this will of course disable other package-building affordances temporarily as well!).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With