EVOLUTION-MANAGER
Edit File: shinyApp.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: Create a Shiny app object</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 shinyApp {shiny}"><tr><td>shinyApp {shiny}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a Shiny app object</h2> <h3>Description</h3> <p>These functions create Shiny app objects from either an explicit UI/server pair (<code>shinyApp</code>), or by passing the path of a directory that contains a Shiny app (<code>shinyAppDir</code>). </p> <h3>Usage</h3> <pre> shinyApp( ui, server, onStart = NULL, options = list(), uiPattern = "/", enableBookmarking = NULL ) shinyAppDir(appDir, options = list()) shinyAppFile(appFile, options = list()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>ui</code></td> <td> <p>The UI definition of the app (for example, a call to <code>fluidPage()</code> with nested controls). </p> <p>If bookmarking is enabled (see <code>enableBookmarking</code>), this must be a single argument function that returns the UI definition.</p> </td></tr> <tr valign="top"><td><code>server</code></td> <td> <p>A function with three parameters: <code>input</code>, <code>output</code>, and <code>session</code>. The function is called once for each session ensuring that each app is independent.</p> </td></tr> <tr valign="top"><td><code>onStart</code></td> <td> <p>A function that will be called before the app is actually run. This is only needed for <code>shinyAppObj</code>, since in the <code>shinyAppDir</code> case, a <code>global.R</code> file can be used for this purpose.</p> </td></tr> <tr valign="top"><td><code>options</code></td> <td> <p>Named options that should be passed to the <code>runApp</code> call (these can be any of the following: "port", "launch.browser", "host", "quiet", "display.mode" and "test.mode"). You can also specify <code>width</code> and <code>height</code> parameters which provide a hint to the embedding environment about the ideal height/width for the app.</p> </td></tr> <tr valign="top"><td><code>uiPattern</code></td> <td> <p>A regular expression that will be applied to each <code>GET</code> request to determine whether the <code>ui</code> should be used to handle the request. Note that the entire request path must match the regular expression in order for the match to be considered successful.</p> </td></tr> <tr valign="top"><td><code>enableBookmarking</code></td> <td> <p>Can be one of <code>"url"</code>, <code>"server"</code>, or <code>"disable"</code>. The default value, <code>NULL</code>, will respect the setting from any previous calls to <code><a href="enableBookmarking.html">enableBookmarking()</a></code>. See <code><a href="enableBookmarking.html">enableBookmarking()</a></code> for more information on bookmarking your app.</p> </td></tr> <tr valign="top"><td><code>appDir</code></td> <td> <p>Path to directory that contains a Shiny app (i.e. a server.R file and either ui.R or www/index.html)</p> </td></tr> <tr valign="top"><td><code>appFile</code></td> <td> <p>Path to a .R file containing a Shiny application</p> </td></tr> </table> <h3>Details</h3> <p>Normally when this function is used at the R console, the Shiny app object is automatically passed to the <code>print()</code> function, which runs the app. If this is called in the middle of a function, the value will not be passed to <code>print()</code> and the app will not be run. To make the app run, pass the app object to <code>print()</code> or <code><a href="runApp.html">runApp()</a></code>. </p> <h3>Value</h3> <p>An object that represents the app. Printing the object or passing it to <code><a href="runApp.html">runApp()</a></code> will run the app. </p> <h3>Examples</h3> <pre> ## Only run this example in interactive R sessions if (interactive()) { options(device.ask.default = FALSE) shinyApp( ui = fluidPage( numericInput("n", "n", 1), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot( plot(head(cars, input$n)) ) } ) shinyAppDir(system.file("examples/01_hello", package="shiny")) # The object can be passed to runApp() app <- shinyApp( ui = fluidPage( numericInput("n", "n", 1), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot( plot(head(cars, input$n)) ) } ) runApp(app) } </pre> <hr /><div style="text-align: center;">[Package <em>shiny</em> version 1.5.0 <a href="00Index.html">Index</a>]</div> </body></html>