In RStudio, I set the knit option to current folder :
When I knit a Markdown document to HTML, this surprisingly happens in a temporary directory (for example : 'Temp\RtmpOa3xSM\preview-11e8c6644fdd.dir' directory).
As far as I can remember, this didn't happen previously : the knit would happen in the directory I selected in the options.
Option rstudio.markdownToHTML isn't set :
getOption('rstudio.markdownToHTML')
NULL
When I close the HTML preview, the HTML document disappears.
The only solution I found to keep the HTML document is to open the document in a Browser and to save it from there.
Bug or am I missing something? Thanks for your help!
[EDIT] other Win 10 users reported to me the same problem
Under certain conditions, RStudio moves the knitted (HTML or PDF) file to a temporary directory (located under tempdir()
). These conditions are:
vignettes
.Typically, this happens when knitting a package vignette and has the purpose of "keep[ing] your vignettes folder from becoming cluttered with HTML files".
Changing the Project build tools, changing the folder name or closing the project prevents this behavior. Another way to keep the generated (HTML or PDF) file is to call rmarkdown::render
interactively (although this is not exactly equivalent to the "Knit" button).
Note that this only affects where the generated file will be saved. The Working Directory while knitting is unaffected.
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