[英]how to hide messages from ggplot in knitr
我正在使用RStudio將R markdown文檔編織成word文件。
我的文檔開頭有這個塊:
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warnings=FALSE, messages=FALSE, results="hide")
```
但是,在直方圖之后,我的文檔中仍然保留這些消息:
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 686 rows containing non-finite values (stat_bin).
我怎樣才能使它們消失?
對於此特定消息,可以通過為binwidth
指定binwidth
參數使其geom_histogram
。 這是一個好習慣,所以您應該這樣做!
通常,您可以通過將message = FALSE
設置為塊選項來禁止顯示message = FALSE
。
現在可以抑制這種情況
, warning = F
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.