RMarkdown chunk option `message=FALSE` does not suppress message.

I noticed that RMarkdown's chunk option message=FALSE does not work on my (also on my colleague's ) environment and could not find its reason.

I tried the most simple example written in 11.7 Hide code, text output, messages, or plots | R Markdown Cookbook , and I can see its message though.

message("You will not see the message.")

I'm not sure what is going on.

I appreciate any hints or suggestions.

Here is my environment.

Windows 10

R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Platform: x86_64-w64-mingw32/x64 (64-bit)

RStudio 2021.9.0.351

rmarkdown : 2.11
knitr: 1.36
rlang: 0.4.11

PS)

Also tried with R-4.1.1 or RStudio 1.4.1717 (not successful).

suppressMessages() is not the best solution.

warning=FALSE works well.

What happens if you render this document ?

---
title: "message"
output: html_document
---

```{r, message=FALSE}
message("You will not see the message.")
```

You should see no message in the output

Using the default will render a document with the message

Thank you for the advice.

Reproduced as same.

image

image

Even in html_document, inline output of the chunk show message.

image

So this might be a bug at inline rendering of RStudio ?

If you mean in the IDE, yes I believe this is an issue. It is track here I think:

1 Like

Thank you for connecting with the issue.
I will wait till it is fixed someday. :blush:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Issue should be fixed in next IDE release, or the one after that. A fix has been merged in RStudio repo - so this is coming !

1 Like