umair durrani
umair durrani

Reputation: 6155

How to suppress all messages in knitr/ Rmarkdown?

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

Upvotes: 7

Views: 9022

Answers (2)

Lauren Goodwin
Lauren Goodwin

Reputation: 212

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.

Upvotes: -1

Yihui Xie
Yihui Xie

Reputation: 30114

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

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

Upvotes: 10

Related Questions