Hi All,
I'm having the following issues with creating a very simple Shiny app. The purpose of the app is to
dynamically display three sets of boxplots and a dynamic table. There is one boxplot per quarter in my dataset, and each time I select a different quarter, I expect the set of boxplots and corresponding table to update.
The problem I am having is when I select different values for the input (i.e., different quarters) the plot does not update and the table shows all NA values.
Below is my code. I have been struggling with this all day. Please help me.
Thank you,
Aaron
ui <- fluidPage(
# Application title
titlePanel("Boxplots of Measures of Performance by Race"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
selectInput(inputId = "Quarter_Num",
label = "Select Quarter:",
choices = c("Quarter 1", "Quarter 2", "Quarter 3"))),
mainPanel(
plotOutput("boxplot"),
tableOutput("info")
)
)
)
server <- function(input, output) {
output$boxplot <- renderPlot({
Restructured_Race_Table %>%
ggplot(aes(x=Race_Desc, y=Percentage, fill = Race_Desc)) +
geom_boxplot() + ylim(0, 100)
})
output$info <- renderTable({
Restructured_Race_Table %>%
group_by(Race_Desc) %>%
summarise(mean_Percentage = mean(Percentage),
median_Percentage = median(Percentage)) %>%
ungroup()
})
}
shinyApp(ui, server)