R - Markdown avoiding package loading messages

前端 未结 4 719
礼貌的吻别
礼貌的吻别 2020-12-02 04:40

I have been using Knitr via R-Studio, and think it is pretty neat. I have a minor issue though. When I source a file in an R-Chunk, the knitr output includes external commen

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 04:57

    You can use include=FALSE to exclude everything in a chunk.

    ```{r include=FALSE}
    source("C:/Rscripts/source.R")
    ```
    

    If you only want to suppress messages, use message=FALSE instead:

    ```{r message=FALSE}
    source("C:/Rscripts/source.R")
    ```
    

提交回复
热议问题