Manually use R Knit / Markdown to create charts for HTML

I use knit()and markdownToHTML()for automatic reporting.

The problem is that I do not display graphics when using these commands. However, when I use the RStudio button Knit HTML, graphics are generated. When I use my own knit / markdown function, it unexpectedly displays a graph. When I switch to another document and insert it, the old plot will appear.

Example:

```{r figA, result='asis', echo=TRUE, dpi=300, out.width="600px", 
              fig=TRUE, fig.align='center', fig.path="figure/"}
plot(1:10)
```

Using commands:

 knit(rmd, md, quiet=TRUE)
 markdownToHTML(md, html, stylesheet=style)

So, I think there are two questions, depending on how you want to approach it:

  • What magic happens in Rstudio Knit HTML?
  • How can I create / enable without depending on the RStudio button Knit HTML?
+3
2

, , , , chunk {...}, . , . - ?

, knitr :

  • ; ;

RStudio .

+1

, , :

: (TRUE; ), ; include = FALSE, , - , - , ; , , ,

{..., include=TRUE} . , .

0

All Articles