Skip to content

Instantly share code, notes, and snippets.

@gadenbuie
Last active January 22, 2023 19:34
Show Gist options
  • Save gadenbuie/e2dd295c8167ade36fcf5efd39dd79be to your computer and use it in GitHub Desktop.
Save gadenbuie/e2dd295c8167ade36fcf5efd39dd79be to your computer and use it in GitHub Desktop.

Disabling messages in Quarto

https://twitter.com/jgeller_phd/status/1616939690132738055

Messages are turned on.

message("hello")
#> hello

With message = FALSE in the chunk header.

message("world")

With #| message = FALSE as and inline chunk option, using knitr syntax.

message("friends")

With `#| message: false as an inline chunk option, using Quarto syntax.

message("friends")

Package versions

packageVersion("knitr")
[1] '1.41'
packageVersion("evaluate")
[1] '0.19'
quarto --version
1.2.313
---
title: "Disabling messages in Quarto"
format: gfm
---
<https://twitter.com/jgeller_phd/status/1616939690132738055>
Messages are turned on.
```{r comment = "#>"}
message("hello")
```
With `message = FALSE` in the chunk header.
```{r, message = FALSE, comment = "#>"}
message("world")
```
With `#| message = FALSE` as and inline chunk option, using knitr syntax.
```{r}
#| message = FALSE,
#| comment = "#>"
message("friends")
```
With `#| message: false as an inline chunk option, using Quarto syntax.
```{r}
#| message: false
#| comment: "#>"
message("friends")
```
Package versions
```{r}
packageVersion("knitr")
packageVersion("evaluate")
```
```{bash}
quarto --version
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment