library(shiny) fluidPage( ## App title ---- titlePanel("City Driving Simulation"), ## Sidebar layout with input and output definitions ---- sidebarLayout( ## Sidebar panel for inputs ---- sidebarPanel( ## Input: Slider for the number of bins ---- sliderInput(inputId = "nblocks", label = "Number of city blocks:", min = 2, max = 50, value = 10), sliderInput(inputId = "nturns", label = "Number of turns:", min = 2, max = 50, value = 25), sliderInput(inputId = "pLeft", label = "Prob. of left turn:", min = 0, max = 1, value = 1/3), sliderInput(inputId = "pRight", label = "Prob. of right turn:", min = 0, max = 1, value = 1/3), actionButton("goButton", "Go!", class = "btn-success"), ), ## Main panel for displaying outputs ---- mainPanel( ## Output: Verbatim text for data summary ---- verbatimTextOutput( "problemStatement"), ## Output: City block path plotOutput(outputId = "pathPlot", width="600px",height="600px"), ## Output probability of going straight verbatimTextOutput(outputId = "pStraight") ) ) )