title: RMarkdown Using comments to make sections optional
body: <p>Is it possible to have entire sections programmatically commented out in RMarkdown. For example, say I have a section of my report :</p>
  <pre><code>### 2.1.   Heading
  
  Blah blah blah my description, with `r variables` and other stuff.
  
  
  #### Table 2.1.1. Sub heading
  
  ```{r table_2_1_1}
  
  kable_2_1_1
  
  ```
  </code></pre>
  <p>Now based on a boolean in the code, I want to completely comment out that whole section. I've tried putting r variables into the report like &quot;&lt; !--&quot; &amp; &quot;--&gt;&quot; but that does not work.</p>