EVOLUTION-MANAGER
Edit File: run.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Run a Shiny document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for run {rmarkdown}"><tr><td>run {rmarkdown}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Run a Shiny document</h2> <h3>Description</h3> <p>Start a Shiny server for the given document, and render it for display. </p> <h3>Usage</h3> <pre> run( file = "index.Rmd", dir = dirname(file), default_file = NULL, auto_reload = TRUE, shiny_args = NULL, render_args = NULL ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>file</code></td> <td> <p>Path to the R Markdown document to launch in a web browser. Defaults to <code>index.Rmd</code> in the current working directory, but may be <code>NULL</code> to skip launching a browser.</p> </td></tr> <tr valign="top"><td><code>dir</code></td> <td> <p>The directory from which to to read input documents. Defaults to the parent directory of <code>file</code>.</p> </td></tr> <tr valign="top"><td><code>default_file</code></td> <td> <p>The file to serve at the Shiny server's root URL. If <code>NULL</code> (the default), a sensible default is chosen (see Details)</p> </td></tr> <tr valign="top"><td><code>auto_reload</code></td> <td> <p>If <code>TRUE</code> (the default), automatically reload the Shiny application when the file currently being viewed is changed on disk.</p> </td></tr> <tr valign="top"><td><code>shiny_args</code></td> <td> <p>Additional arguments to <code><a href="../../shiny/html/runApp.html">runApp</a></code>.</p> </td></tr> <tr valign="top"><td><code>render_args</code></td> <td> <p>Additional arguments to <code><a href="render.html">render</a></code>.</p> </td></tr> </table> <h3>Details</h3> <p>The <code>run</code> function runs a Shiny document by starting a Shiny server associated with the document. The <code>shiny_args</code> parameter can be used to configure the server; see the <code><a href="../../shiny/html/runApp.html">runApp</a></code> documentation for details. </p> <p>Once the server is started, the document will be rendered using <code><a href="render.html">render</a></code>. The server will initiate a render of the document whenever necessary, so it is not necessary to call <code>run</code> every time the document changes: if <code>auto_reload</code> is <code>TRUE</code>, saving the document will trigger a render. You can also manually trigger a render by reloading the document in a Web browser. </p> <p>The server will render any R Markdown (<code>.Rmd</code>) document in <code>dir</code>; the <code>file</code> argument specifies only the initial document to be rendered and viewed. You can therefore link to other documents in the directory using standard Markdown syntax, e.g. <code>[Analysis Page 2](page2.Rmd)</code>. </p> <p>If <code>default_file</code> is not specified, nor is a file specified on the URL, then the default document to serve at <code>/</code> is chosen from (in order of preference): </p> <ul> <li><p>If <code>dir</code> contains only one <code>Rmd</code>, that <code>Rmd</code>. </p> </li> <li><p>The file ‘<span class="file">index.Rmd</span>’, if it exists in <code>dir</code>. </p> </li> <li><p>The first <code>Rmd</code> that has <code>runtime: shiny</code> in its YAML metadata. </p> </li> <li><p>The file ‘<span class="file">index.html</span>’ (or ‘<span class="file">index.htm</span>’), if it exists in <code>dir</code>. </p> </li></ul> <p>If you wish to share R code between your documents, place it in a file named <code>global.R</code> in <code>dir</code>; it will be sourced into the global environment. </p> <h3>Value</h3> <p>Invisible NULL. </p> <h3>Note</h3> <p>Unlike <code><a href="render.html">render</a></code>, <code>run</code> does not render the document to a file on disk. In most cases a Web browser will be started automatically to view the document; see <code>launch.browser</code> in the <code><a href="../../shiny/html/runApp.html">runApp</a></code> documentation for details. </p> <p>When using an external web browser with the server, specify the name of the R Markdown file to view in the URL (e.g. <code>http://127.0.0.1:1234/foo.Rmd</code>). A URL without a filename will show the <code>default_file</code> as described above. </p> <h3>Examples</h3> <pre> ## Not run: # Run the Shiny document "index.Rmd" in the current directory rmarkdown::run() # Run the Shiny document "shiny_doc.Rmd" on port 8241 rmarkdown::run("shiny_doc.Rmd", shiny_args = list(port = 8241)) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>rmarkdown</em> version 2.3 <a href="00Index.html">Index</a>]</div> </body></html>