title: Shiny: runExample gives error (Can't call `runApp()` from within `runApp()`)
body: <p>I'm using rmarkdown (1.4) / knitr (1.15.1) in Rstudio to create an R markdown HTML page. I'm incorporating shiny into the file to make an interactive doc (via <code>runtime: shiny</code>). </p>
  
  <p>When I try to run an example from Shiny, I get an error:</p>
  
  <pre><code>```{r, eval=TRUE,chunk_title='Shiny_Example'}
  runExample("01_hello")
  ```
  </code></pre>
  
  <blockquote>
    <p>Error: can't call <code>runApp()</code> from within <code>runApp()</code>. If your application code contains <code>runApp()</code>, please remove it. </p>
  </blockquote>
  
  <p>If I run the code outside of an R markdown code chunk, I can get the app to load just fine (even in the same session of Rstudio).</p>
  
  <p>I did notice that the <code>runExample</code> code uses <code>runApp</code> and not <code>shinyapp</code>. </p>
  
  <p>Is <em>this</em> the root of my problem? Or am I possibly doing something else wrong?? </p>
  
  <hr>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>---
  title: "Shiny Not Working"
  output: html_document
  runtime: shiny
  ---
  
  ```{r, eval=TRUE,chunk_title='Shiny_Example'}
  library(shiny)
  runExample("01_hello")
  ```
  </code></pre>
  
  <p><strong>Full Error w/ Stack Trace:</strong></p>
  
  <pre><code>Warning: Error in runApp: Can't call `runApp()` from within `runApp()`. 
  If your application code contains `runApp()`, please remove it.
  
  Stack trace (innermost first):
  117: runApp
  116: runExample
  115: eval
  114: eval
  113: withVisible
  112: withCallingHandlers
  111: handle
  110: timing_fn
  109: evaluate_call
  108: evaluate::evaluate
  107: evaluate
  106: in_dir
  105: block_exec
  104: call_block
  103: process_group.block
  102: process_group
  101: withCallingHandlers
  100: process_file
   99: knitr::knit
   98: &lt;Anonymous&gt;
   97: do.call
   96: contextFunc
   95: .getReactiveEnvironment()$runWith
   94: shiny::maskReactiveContext
   93: &lt;reactive&gt;
   82: doc
   81: shiny::renderUI
   80: func
   79: origRenderFunc
   78: output$__reactivedoc__
    3: &lt;Anonymous&gt;
    2: do.call
    1: rmarkdown::run
  </code></pre>
  
  <p><strong>Also Note:</strong></p>
  
  <p>Running other shiny code works fine with this set-up:</p>
  
  <pre><code>---
  title: "Shiny Not Working"
  output: html_document
  runtime: shiny
  ---
  
  ```{r, eval=TRUE,chunk_title='Simple_Shiny'}
  library(shiny)
  ui &lt;- fluidPage()
  server &lt;- function(input, output){}
  shinyApp(ui = ui, server = server)
  ```
  </code></pre>
  
  <hr>
  
  <p>sessionInfo of note:</p>
  
  <pre><code>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
  
  shiny_1.0.1  rmarkdown_1.4  knitr_1.15.1
  </code></pre>