title: Evaluate inline r code in rmarkdown figure caption
body: <p>I am using RStudio and knitr to knit .Rmd to .docx</p>
  
  <p>I would like to include inline code in figure captions e.g. something like the following in the chunk options:</p>
  
  <p>fig.cap = "Graph of <code>nrow(data)</code> data points" </p>
  
  <p>However, knitr does not evaluate this code, instead just printing the unevaluated command. </p>
  
  <p>Is there a way to get knitr to evaluate r code in figure/table captions?</p>