knitr (R) - how not to embed images in the HTML file?

前端 未结 4 764
醉梦人生
醉梦人生 2020-12-05 18:13

This is probably very easy but I can\'t seem to find it in docs. I would like to not embed the generated images in the HTML file itself.

So basically I want knit2htm

4条回答
  •  隐瞒了意图╮
    2020-12-05 18:48

    Here is a simple way to have figures in a separate html file, which will reduce its size significantly.

    Add this chunk in the beginning of the *.rmd file:

    ```{r global_options, include=FALSE}
    #suppress the warnings and other messages from showing in the knitted file.
    knitr::opts_chunk$set(fig.width=8, fig.height=6, fig.path='Figs/',
                          echo=TRUE, warning=FALSE, message=FALSE)
    ```
    

    Option 'fig.path' tells R to save pictures into 'Figs' folder. The rest of options is not required for the task.

    Click this button:

    Make sure the check box is not checked:

提交回复
热议问题