My interactive ggplot won't show up on my shiny app but will show up in RStudio and react to the changes from the shiny application. It was fine until I made the graph interactive and not sure why it has changed.
server <- function(input, output) {
output$selected_nation <- renderText({
paste("You have selected", input$Nationality)
})
output$coolplot <- renderPlot({
ngo <-
ngo %>%
filter(Victim.Nationality == input$Nationality,
Victim.Gender == input$genderInput
)
p = ggplot(ngo, aes(x = Victim.Age, fill = Trafficking.Type)) +
geom_bar(position = "stack")
ggplotly(p)
})
The graph to work within the shiny app.