title: Embedding Shiny app in knitr document
body: <p>I have a shiny app which has a ui.R, server.R and global.R. The app directory (name = dash) contains the folder 'data' in which the dataset resides. Also, this app folder is inside the project's working directory.
  In global.R I read the data as:</p>
  
  <pre><code>dash &lt;- read.table("data/ntraj1acc.txt", sep=",", header=T)
  </code></pre>
  
  <p>This app works fine. Now, I am trying to embed it in a ioslides presentation which otherwise works good. The example in <a href="http://rmarkdown.rstudio.com/authoring_embedded_shiny.html" rel="noreferrer">External Applications</a> section on rmarkdown website also works perfect in my presentation. But when I replace the path in <code>system.file</code> to my app, I get the error:</p>
  
  <pre><code>No Shiny application exists at the path ""
  </code></pre>
  
  <p>Here is how I replaced the path:</p>
  
  <pre><code>shinyAppDir(
    system.file("dash", package="shiny"),
    options=list(
      width="100%", height=700
    )
  )
  </code></pre>
  
  <p>After the error, I tried following:</p>
  
  <pre><code>shinyAppDir(
    "C:/Users/durraniu/Documents/Trajectory-one/dash",
    options=list(
      width="100%", height=700
    )
  )
  </code></pre>
  
  <p>But then I got a new error:</p>
  
  <pre><code>object 'dash' not found
  </code></pre>
  
  <p>Which means that it is not parsing global.R.  </p>
  
  <p>How can I fix this problem?</p>