title: Run R code inside stargazer function
body: <p>I have a code chunk in a .Rnw file like this:</p>
  
  <pre><code>&lt;&lt;test, results = "asis"&gt;&gt;=
  
  stargazer(mtcars, notes = c($n$ = \\Sexpr{nrow(mtcars)})
  
  @
  </code></pre>
  
  <p>When I use <code>knitr</code> to evaluate the R code and convert the .Rnw file to a .tex file, how can I get <code>nrow(mtcars)</code> to evaluate?</p>