title: Shiny Programming Error: Warning: Error in sourceUTF8: Stack trace (innermost first):
body: <p>I'm coding a logistic regression app with several conditional panels that should show the resulting probability depending upon the prompt that the user selects... but instead the page doesn't load when I run the app and I get an error like: </p>
  
  <blockquote>
    <p>Listening on <a href="http://127.0.0.1:6497" rel="nofollow noreferrer">http://127.0.0.1:6497</a> Error in parse(file, keep.source =
    FALSE, srcfile = src, encoding = enc) unexpected end of input 172:   )
    173: 
        ^ Warning: Error in sourceUTF8: Error sourcing C:\Users Stack trace (innermost first):
        1: runApp</p>
  </blockquote>
  
  <p>Should I be using a switch case in server.R instead? Thanks.</p>
  
  <pre><code>    UI.R
      pageWithSidebar(
  
      # Application title
      headerPanel("Steadylosing NBA Probability Set (5200+ Observations)"),
  
  
          # Sidebar with conditional slider inputs 
          sidebarLayout(
      sidebarPanel(
        selectInput(
          "Occur",
          "Pick One Outcome to Predict:",
          choices = c(
            "TeamAWin",
            "BothTeamsAllow110+"
          )
        ),
        conditionalPanel(
          condition = "input.Occur == 'TeamAWin",
          sliderInput("aoff", "A's Offensive Rating", 90, 125, 100, .1),
          sliderInput("adef", "A's Defensive Rating", 90, 125, 100, .1),
          sliderInput("boff", "B's Offensive Rating", 90, 125, 100, .1),
          sliderInput("bdef", "B's Defensive Rating", 90, 125, 100, .1),
          selectInput("homecourt", "Homecourt, Yes or No?", choices = c(0, 1))
        ),
        conditionalPanel(
          condition = "input.Occur == 'BothTeamsAllow110+",
          sliderInput("aoff2", "A's Offensive Rating", 90, 125, 100, .1),
          sliderInput("adef2", "A's Defensive Rating", 90, 125, 100, .1),
          sliderInput("boff2", "B's Offensive Rating", 90, 125, 100, .1),
          sliderInput("bdef2", "B's Defensive Rating", 90, 125, 100, .1),
          selectInput("ot2", "Overtime, Yes or No?", choices = c(0, 1)),
          sliderInput("combpace2", "Combined Pace of the Two Teams", 170, 220,     200, .1)
        )
  
      ),
  
      # Show prediction values
        mainPanel(
  
        h2(textOutput("Prediction1")),
  
        h2(textOutput("Prediction2"))
    )
  
  
  
  
  Server.R 
          shinyServer(function(input, output, session) {
    sliderValues &lt;- reactive({
  
      # Compose data frame
      data.frame(
        Name = c("aoff", #TeamAoffrtg
                 "adef", #TeamAdefrtg
                 "boff", #TeamBoffrtg
                 "bdef", #TeamBdefrtg
                 "homecourt",
                 "aoff2", #TeamAoffrtg
                 "adef2", #TeamAdefrtg
                 "boff2", #TeamBoffrtg
                 "bdef2", #TeamBdefrtg
                 "ot2", #Overtime
                 "combpace2"),
  
        Value = as.double(c(input$aoff,
                            input$adef,
                            input$boff,
                            input$bdef,
                            input$homecourt,input$aoff2,
                            input$adef2,
                            input$boff2,
                            input$bdef2,
                            input$ot2,
                            input$combpace2)),
        stringsAsFactors=FALSE)
  
    } )
  
    function1 &lt;- function(aoff,adef,boff,bdef,homecourt) {
      100*((exp(-1.9418+.1572*aoff-.144*adef-.139*boff+.1414*bdef+.4341*homecourt))/(1+exp(-1.9418+.1572*aoff-.144*adef-.139*boff+.1414*bdef+.4341*homecourt)))
    }
    function2 &lt;- function(aoff2,adef,boff,bdef,ot2,combpace2) {
      100*((exp(-74.6058-.0788*aoff2+.0874*adef+.0795*boff-.09166*bdef+2.8053*ot2+.1897*combpace2))/(1+exp(-74.6058-.0788*aoff2+.0874*adef+.0795*boff-.09166*bdef+2.8053*ot2+.1897*combpace2)))
    }
    output$Prediction1 &lt;- renderText({
      predtype &lt;- input$Occur
      if (predtype == "TeamAWin"){
      c(round(function1((input$aoff),(input$adef),(input$boff),(input$bdef),(input$homecourt)),4),"%")
  
      }
      })
    output$Prediction2 &lt;- renderText({  predtype &lt;- input$Occur
      if (predtype == "BothTeamsAllow110+"){
      c(round(function2(input$aoff2, input$adef2,input$boff2,input$bdef2,input$ot2,input$combpace2),4),"%")
  
      }
    })
  
    else {
   return()
     }
  
  }
  )
  </code></pre>