title: paste r commands inside rmarkdown file
body: <p>I want my function to place a piece of markdown in a readme.rmd file. However I would like to include some rcode that that will be executed when a new version of the readme file is rendered. </p>
  
  <p>This is what I want in the readme.rmd:</p>
  
  <p><code>[![Last-changedate](https://img.shields.io/badge/last%20change-</code>r gsub("-", "--", Sys.Date())<code>-yellowgreen.svg)](/commits/master)"</code></p>
  
  <p>Which at knitr time will turn into a nicely formated shield with the date.</p>
  
  <p>However to paste this in the document I have to escape some of the characters:</p>
  
  <p><code>paste0("`r ", "gsub(\"-\", \"--\", Sys.Date())", "`")
  </code></p>
  
  <p>But this results into
  <code>
  [![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub(\"-\", \"--\", Sys.Date())`-yellowgreen.svg)](/commits/master)"
  </code>
  And this cannot be rendered by rmarkdown error: unexpected input: gsub(\ ^....</p>