title: In-line R expression returns incorrect value
body: <p>If the R code in Rmd file reuses the same variable name, the inline r expressions seem to return the last value of this variable regardless of the location of the inline expression. Is there away to avoid this behavior except for making sure the same variable name is not reused in different parts of the document?</p>
  
  <p>The reproducible example </p>
  
  <pre><code>---
  title: "R Notebook"
  output: html_notebook
  ---
  
  
  ```{r}
  df &lt;- cars
  nrow(df)
  ```
  
  The dataset has `r nrow(df)` rows.
  
  
  ```{r}
  df &lt;- iris
  nrow(df)
  ```
  
  The dataset has `r nrow(df)` rows.
  </code></pre>
  
  <p>This produces the following output</p>
  
  <p><a href="https://i.stack.imgur.com/5xLuI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5xLuI.png" alt="enter image description here"></a></p>
  
  <p>I am using:
  R version 3.3.2 (2016-10-31)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows 7 x64 (build 7601) Service Pack 1</p>
  
  <p>rmarkdown_1.4
  knitr_1.15.1</p>