2 years ago

#66492

test-img

anaximander

shiny server isn't interacting with any inputs

I'm having a weird problem where my shiny app works perfectly well on my local machine, but when I try to run it off a shiny server (on an EC2 instance), the inputs stop working. When I try to reference inputs in, for example, if statements, it will produce an error saying:

Error in if: argument is of length zero

It's like the inputs don't even exist.

Even something as simple as this code will only return "You've chosen the tool" as the text.

library(shinyWidgets) 
library(shiny)

ui <- fluidPage(sidebarLayout(
                  sidebarPanel(width = 3,
                    radioGroupButtons("tool", label = h4(strong("Select a Tool:")),
                                      choices = c("Records", "Team Sheets"),
                                      selected = "Records")
                  ),
                  mainPanel(width = 9,
                            htmlOutput("chosen_tool"))
  )
)

server <-function(input, output) {

  output$chosen_tool <- renderText({paste("You've chosen the", input$tool, "tool.", sep = " ")})

}

shinyApp(ui, server)

I've double checked to make sure that the environment is clear on my local machine, and all packages are up to date on the server.

r

shiny

shiny-server

0 Answers

Your Answer

Accepted video resources