title: output markdown in r code chunk
body: <p>I have a R markdown file that I want to output rmarkdown from the script itself. For example, I would have the following simple code in an Rmd file.</p>
  
  <pre><code>---
  title: "test"
  author: "johndoe"
  date: "September 5, 2015"
  output: html_document
  ---
  
  ```{r setup, include=FALSE}
  knitr::opts_chunk$set(echo = TRUE)
  ```
  
  ```{r cars}
  paste("## This is a Heading in Code")
  summary(cars)
  ```
  </code></pre>
  
  <p>I want "This is a Heading in Code" to render in rmarkdown. There is a solution in an R script to generate markdown as per <a href="http://rmarkdown.rstudio.com/r_notebook_format.html" rel="noreferrer">http://rmarkdown.rstudio.com/r_notebook_format.html</a>. But I am trying to figure out how to do this in a Rmarkdown file. Any help appreciated. Thanks.</p>