0

I have created the following R Notebook in RStudio:

---
title: "test"
author: "by me"
date: 'last updated: Jan 23, 2022'
output:
  html_notebook:
    toc: yes
    toc_float: yes
    number_sections: yes
    highlight: haddock
---

# First headline

## Packages don't load quietly

```{r}
library(tidyverse, warn.conflicts = F, quietly = T)
```

Now, irrespective if I just preview the file (which I understand is the html notebook file) or if I knit it to html I get the full babbling when loading the package. If I just "preview" I only get it the first time I preview. When knitting to html, the all messages always appear.

(BTW: if someone could explain to me the differences between the "preview" version and "knit to HTML", that would be great.)

deschen
  • 10,012
  • 3
  • 27
  • 50
  • 2
    https://stackoverflow.com/a/60275813/11485370 Try this solution? – Desmond Jan 24 '22 at 08:09
  • Yes, it does indeed. Thank you! I won't use it for the whole file, but my workaround now would be to create one line of code where I say `{r eval = FALSE}`, so that it does show the respective code in the output, and then the same code again, but this time with `{r include = FALSE}`, so that it does load the packages, but doesn't show the code in the html. – deschen Jan 24 '22 at 08:22

1 Answers1

1

you can try {r message=FALSE}.

Erfan Ghasemi
  • 337
  • 2
  • 6