Reputation: 1501
I'm using RStudio to knit my R markdown document into a word file.
I have this chunk in the beginning of my document:
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warnings=FALSE, messages=FALSE, results="hide")
```
But, I still keep have these messages inside my document after an histogram:
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 686 rows containing non-finite values (stat_bin).
How can I make them go away?
Upvotes: 4
Views: 6318
Reputation: 121137
For this particular message, you can make it disappear by specifying the binwidth
argument to geom_histogram
. This is good practise, so you should do it!
In general, you can suppress messages by setting message = FALSE
as a chunk option.
Upvotes: 14