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 do.call: second argument must be a list
[No stack trace available
Would love any suggestions. Thanks!
tabItem(tabName = "teamstats",
h2("Team Stats"),
fluidRow(
column(5,
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]
do.call(infoBox, team)
})
}