Creating info box with variable input

I am trying to set it up where different data will show depending on the input that the user selects. I have included my body tab as well as what I have on the server side. Here is the error I am getting:

Warning: Error in second argument must be a list
[No stack trace available

Would love any suggestions. Thanks!

    tabItem(tabName = "teamstats",
            h2("Team Stats"),
                   selectInput("teamselect", h3("Team"), 
                               choices = list("Oregon" = 1, "Villanova" = 2,
                                              "Oklahoma" = 3), selected = 1))
server <- function(input, output) {
  output$teamstatsBox <- renderInfoBox({
    team <- switch(input$teamselect,
                   "Oregon" = list(sampteam$X.1, "darkgreen", "%Oregon"),
                     "Villanova" = list(sampteam$X.1, "lightblue", "%Villanova"),
                     "Oklahoma" = list(sampteam$X.1, "red", "%Oklahoma"))
    infoBox("Team Points", value = sampteam$X.1, icon = shiny::icon("users", color = "aqua", width = "4"))
    team$min <- input$range[1]
    team$max <- input$range[3], team)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.