I often knit R Markdown documents in RStudio. That is, I click the "Knit" icon or use a keyboard shortcut to have my documents rendered by rmarkdown::render(). Sometimes, when I do so, the output in the R Markdown pane concludes with a message like
Output created: myDoc.html
There were 15 warnings (use warnings() to see them)
How can I view these warnings? I would like to see them in the output to the R Markdown pane, or by typing warnings() in the console -- or ideally, in both ways.
Of course, I could see them if I ran rmarkdown::render('myDoc.Rmd') in the console, instead of using the RStudio shortcuts. But that approach is inconvenient. I also don't want to modify options for individual code chunks.
A very similar question came up about four years ago, but no solutions were posted.