Most R Markdown users may know that code blocks can be folded in HTML output. Then @rkb965 asked a good question on how to fold messages and warnings. The answer was not clear to me in the beginning, but later I recalled a contribution by @atusy and came up with this solution:

—
title: "Test"
output: html_document: code_folding: show
— ```{r, setup, …