title: Getting Error: comparison (3) is possible only for atomic and list types
body: <p>I tried to make a simple shiny app and used the code below</p>
  
  <pre><code>library(shiny)
  library(MASS)
  ui&lt;-fluidPage(
    sidebarPanel(sidebarLayout(
      sliderInput(inputId = "num",label = "choose number of items to   display",min=1,max=25,value=5))),
    mainPanel(
      tableOutput("head"))
  
  
  )
  server&lt;-function(input,output){
  
    inp&lt;-reactive({switch(input$num)})
  
    output$head&lt;-renderTable({head(painters,inp)})
  }
  
  shinyApp(ui=ui, server=server)
  </code></pre>
  
  <p>When I execute it, I get the following error</p>
  
  <pre><code>ERROR:comparison (3) is possible only for atomic and list types
  </code></pre>
  
  <p>What is the cause of this error?</p>