title: dynamic tabsets with multiple plots r markdown
body: <p>I managed to create a html document that creates dynamic tabsets based on a list of items. Adding one plot works fine on one tabset. How can I add now multiple plots on one tabset?</p>
  
  <p>Hereby the code I started from but it only shows 1 plot per tabset when you knit the document to html output. obviously there is still something missing. </p>
  
  <pre><code>---
  title: "R Notebook"
  output:
    html_document:
      df_print: paged
  editor_options:
    chunk_output_type: inline
  ---
  
  
  ### header 1
  ```{r}
  library(ggplot2)
  df &lt;- mtcars
  
  pl_list &lt;- list()
  
  pl1 &lt;- qplot(cyl, disp, data = df[1:12,])
  pl2 &lt;- qplot(mpg, cyl, data = df[13:20,])
  pl3 &lt;- qplot(mpg, cyl, data = df[21:30,])
  pl4 &lt;- qplot(mpg, cyl, data = df[1:12,])
  
  pl_list[[1]] &lt;- list(pl1, pl3,  "one")
  pl_list[[2]] &lt;- list(pl2, pl4,  "two")
  ```
  
  
  ### header {.tabset}
  ```{r, results = 'asis', echo = FALSE}
  
  for (i in seq_along(pl_list)){
    tmp &lt;- pl_list[[i]]
    cat("####", tmp[[3]], " \n")
    print(tmp[1])
    cat(" \n\n")
    }
  ```
  </code></pre>