Default code folding by individual chunk in rmarkdown : <p>I am writing up a lesson in HTML using rmarkdown to demonstrate how to implement analytic methods in R, and because of this the document has a lot of code that is needed to understand those methods, but also a lot of code that is used only for generating plots and figures. I would like to show the first sort of code by default, and leave the plotting code available for students to view but hidden by default.</p>

<p>I know that rmarkdown has recently added support for code folding by setting the <code>code_folding</code> html_document argument to either <code>show</code> or <code>hide</code>. However, this either leaves all code chunks unfolded or folded by default -- is there any way to indicate whether <strong>individual</strong> code chunks should be shown or folded by default while allowing code folding?</p>

<p>Thank you!</p>
