View source: R/runAppWithParams.R
runAppWithParams | R Documentation |
This function will run a Shiny app but will pass arbitrary parameters ('NAME = VALUE') through the '...' parameter to the application. This is done by modifying the Shiny UI and server function environments.
This function will traverse up the environment tree looking for the given parameter. Optionally, if 'type_check' is set to an 'is.' type function (e.g. 'is.numeric', 'is.list', etc.) it will check the object type. If the object is not found or the type doesn't match it will throw an error.
runAppWithParams(ui, server, ...)
get_shiny_parameter(param, type_check)
ui |
the Shiny ui object. |
server |
the Shiny server object. |
... |
[shiny::runApp()] parameters, [shiny::shinyApp()] parameters, or parameters to pass to the Shiny app. |
param |
the parameter name. |
type_check |
an 'is.' function (e.g. 'is.numeric') to test the parameter type. |
if (interactive()) { # Only run this example in interactive R sessions
library(ShinyDemo)
data(mtcars)
data(faithful)
runAppWithParams(ui = ShinyDemo::df_viewer_ui,
server = ShinyDemo::df_viewer_server,
data_frames = list(mtcars = mtcars, faithful = faithful),
port = 2112)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.