title: View markdown generated html in RStudio viewer
body: <p>I would like to see <code>html</code> file that is generated using <code>markdown</code> in <strong>RStudio viewer</strong>, but <code>rstudio::viewer('test.html')</code> opens my file in browser outside RStudio. Could you tell me how can I achieve this?</p>
  
  <p><a href="https://stackoverflow.com/questions/22863771/is-it-possible-to-view-an-html-table-in-the-viewer-pane">THIS</a> example works but I don't know why my example doesn't work in that way. </p>
  
  <p><code>test.html</code> file it'a an complied example that we get when we choose new file -> R Markdown.</p>
  
  <p><strong>EDIT</strong> (according to Roman Luštrik comment)</p>
  
  <pre><code>library(knitr)
  library(markdown)
  f &lt;- system.file("examples", "knitr-minimal.Rmd", package = "knitr")
  knit(f)
  markdownToHTML('knitr-minimal.md',output='knitr-minimal.html')
  rstudio::viewer('knitr-minimal.html')
  </code></pre>