4

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?

1
  • 6
    try removing the "s" from warnings and messages. Here's the annotated list of syntactically correct knitr chunk options: yihui.name/knitr/options Commented Aug 12, 2016 at 13:08

2 Answers 2

14

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.

Sign up to request clarification or add additional context in comments.

Comments

4

The option to suppress this is now

, warning = F

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.