shiny (version 0.6.0)

runApp: Run Shiny Application

Description

Runs a Shiny application. This function normally does not return; interrupt R to stop the application (usually by pressing Ctrl+C or Esc).

Usage

runApp(appDir = getwd(), port = 8100L,
    launch.browser = getOption("shiny.launch.browser", interactive()))

Arguments

appDir
The directory of the application. Should contain server.R, plus, either ui.R or a www directory that contains the file index.html. Defaults to the working directory.
port
The TCP port that the application should listen on. Defaults to port 8100.
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.

Examples

Run this code
# Start app in the current working directory
runApp()

# Start app in a subdirectory called myapp
runApp("myapp")


# Apps can be run without a server.r and ui.r file
runApp(list(
  ui = bootstrapPage(
    numericInput('n', 'Number of obs', 100),
    plotOutput('plot')
  ),
  server = function(input, output) {
    output$plot <- renderPlot({ hist(runif(input$n)) })
  }
))

Run the code above in your browser using DataCamp Workspace