I want to render an R Markdown file quietly, i.e nothing should be displayed in the console. Let foo.Rmd be the following file:
---
title: "Foo"
output:
html_vignette
vignette: >
%\VignetteIndexEntry{Foo}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r}
library(survey)
```
Using rmarkdown::render("foo.Rmd", quiet = TRUE) works correctly. However, if I add message=FALSE to the chunk, then some messages generated by the loading of the package appear:
---
title: "Foo"
output:
html_vignette
vignette: >
%\VignetteIndexEntry{Foo}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, message=FALSE}
library(survey)
```
> rmarkdown::render("foo.Rmd", quiet = TRUE)
Loading required package: grid
Loading required package: Matrix
Loading required package: survival
Attaching package: 'survey'
The following object is masked from 'package:graphics':
dotchart
(Note that you have to restart the session each time you add or remove message=FALSE, as the messages are displayed only once per session.)
Is this a bug? Or am I missing something?