Using a block header to save a graph

So, I searched for an answer for this and found nothing. I hope there is nothing like this on board, so I am not wasting anyone's time. In a recent update, I accept RStudio, the method I used to save the graphs is gone. Below is an example of what it looks like:

```{r dummy, dev=c('png', 'pdf'), fig.height=4, fig.width=6}

x = 1:10
y = 10:1

plot(x,y)
```

      

The code will compile when I do this. However, when I chain in my code to preserve the plots, it doesn't preserve the graphics. Is there a way similar to this that is compatible with the updated RStudio / knitr? Thanks for the help!

+2


source to share


1 answer


you can add the self_contained: no parameter in the output section of the html_document output at the top of your Rmd. but the images are inline in html so you don't really need the images folder - rawr

EDIT:

So:



---
output:
  html_document:
    self_contained: no
    <other options>
---

res of knitr document...

      

this will create a couple of new directories and inside figure-html you can find images.

+1


source







All Articles