Run Shiny Example Applications — runExample
R/runapp.R
Description
Launch Shiny example applications, and optionally, your system's web browser.
Arguments
- example
The name of the example to run, or
NA
(the default) to list the available examples.- port
The TCP port that the application should listen on. If the
port
is not specified, and theshiny.port
option is set (withoptions(shiny.port = XX)
), then that port will be used. Otherwise, use a random port between 3000:8000, excluding ports that are blocked by Google Chrome for being considered unsafe: 3659, 4045, 5060, 5061, 6000, 6566, 6665:6669 and 6697. Up to twenty random ports will be tried.- 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
shiny.host
option, if set, or"127.0.0.1"
if not.- display.mode
The mode in which to display the example. Defaults to
"auto"
, which uses the value ofDisplayMode
in the example'sDESCRIPTION
file. Set to"showcase"
to show the app code and description with the running app, or"normal"
to see the example without code or commentary.- package
The package in which to find the example (defaults to
"shiny"
).To provide examples in your package, store examples in the
inst/examples-shiny
directory of your package. Each example should be in its own subdirectory and should be runnable whenrunApp()
is called on the subdirectory. Example apps can include aDESCRIPTION
file and aREADME.md
file to provide metadata and commentary about the example. See the article on Display Modes on the Shiny website for more information.