title: How to use RStudio to write R Markdown files with Stata graphs?
body: <p>The code below works for Stata commands and output but does not produce the graphs:</p>
  
  <pre><code>---
  title: "Stata and R Markdown (Windows)"
  author: "Doug Hemken"
  date: "July 2015"
  output: 
  html_document:
  toc: yes
  ---
  
  ```{r, echo=FALSE, message=FALSE}
  require(knitr)
  statapath &lt;- "/Applications/Stata/StataSE.app/Contents/MacOS/stata-se"
  opts_chunk$set(engine="stata", engine.path=statapath, comment="")
  ```
  
  ### Descriptive Statistics
  A simple example.
  
  ```{r}
  sysuse auto
  summarize
  ```
  
  ```{r}
  sysuse auto
  twoway (scatter mpg weight)
  ```
  </code></pre>
  
  <p>Note that this is a follow-up of this question:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/q/32581867/707145">How to use RStudio to write a RMarkdown file with Stata commands?</a>. </li>
  </ul>