Cache folder for numbers delete itself after knitting html / pdf on RMarkdown

This problem seems strange to me: I have multiple graphs and tables that are generated in my RMarkdown document, so I would like to cache to save compilation / knitting time. When I change all of the cache parameters to cache = TRUE, it creates two folders in my directory: "Figures_Full_Study_cache" and "Figures_Full_Study_figures" as I would expect. The problem is that the former (_cache) remains, the latter (_figures) removes itself after compilation.

However, I can see the "Figures_Full_Study_cache" and "Figures_Full_Study_figures" folders created. I can even go into the "Figures_Full_Study_figures" folder and see how each individual .png is generated in real time. However, once Markdown / pandoc is complete, the "Figures_Full_Study_figures" file will be immediately deleted (I have screenshots from all of this, but I'm too new to Stack Overflow to post images).

Of course, as soon as this file disappears along with the .png images, R generates an error when I try to run it again using cache = TRUE, because those files don't exist (tables work very well). Any ideas why my cached file is deleting itself? I have included a representative example of how my plots are generated using ggplot2 and introduced into RMarkdown:

```{r,echo=FALSE, warning=FALSE, fig.width=5,fig.height=3.5,cache=TRUE}
     ggplot(Demographics, aes(x=Exp)) +
     geom_histogram(binwidth=2,fill="slateblue1", color="black", alpha=.9) +
     theme_general # Defined previously, not relevant to this discussion
     # My apologies for not being able to post the data... protected research.
```

      

And here are the options for the Markdown document if needed:

---
title: "Figures Full Study"
author: "Name"
date: "Wednesday, August 13, 2014"
output:
  html_document: default
---

      

+3


source to share





All Articles