How to suppress all messages in knitr/ Rmarkdown?

前提是你 提交于 2019-12-10 13:32:31

问题


I have used dplyr for some of the analyses and for a particular code it takes about 30 seconds to complete the operation. In the resulting HTML I get a very long output of something like this (reproducing last few lines):

|================================================ |100% ~0 s remaining     
|================================================ |100% ~0 s remaining     
Completed after 35 s

I don't want this to show in the output. How can I suppress this? Is there anythink in the global chunk options of knitr that could stop these messages


回答1:


I think you want the chunk option results='hide' for that particular code chunk only.

```{r results='hide'}
# do your dplyr computation here
```



回答2:


or do message='hide' or if you have a warning you do waring='hide'.

Depends on what is showing but if you look up chunk options in google you can find which one will hide what you are wanting to hide.



来源:https://stackoverflow.com/questions/26456924/how-to-suppress-all-messages-in-knitr-rmarkdown

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!