runExample | R Documentation |
Launch Shiny example applications, and optionally, your system's web browser.
runExample(
example = NA,
port = getOption("shiny.port"),
launch.browser = getOption("shiny.launch.browser", interactive()),
host = getOption("shiny.host", "127.0.0.1"),
display.mode = c("auto", "normal", "showcase"),
package = "shiny"
)
example |
The name of the example to run, or |
port |
The TCP port that the application should listen on. If the
|
launch.browser |
If true, the system's default web browser will be launched automatically after the app is started. Defaults to true in interactive sessions only. |
host |
The IPv4 address that the application should listen on. Defaults
to the |
display.mode |
The mode in which to display the example. Defaults to
|
package |
The package in which to find the example (defaults to
To provide examples in your package, store examples in the
|
## Only run this example in interactive R sessions
if (interactive()) {
# List all available examples
runExample()
# Run one of the examples
runExample("01_hello")
# Print the directory containing the code for all examples
system.file("examples", package="shiny")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.