First time using pickerInput, having trouble dynamically changing it when running the app. Am I overlooking something? Here are the respective UI and server sections.
tabItem(
tabName = "data_tab",
fluidRow(
column(
width = 6,
box(
title = "Filter data by school and year",
solidHeader = TRUE,
status = "info",
width = 12,
pickerInput(
inputId = "data_schools",
label = "Select School(s)",
choices = schools,
selected = schools,
multiple = TRUE,
options = list(
`actions-box` = TRUE,
`live-search` = TRUE,
`selected-text-format` = "count > 3"
)
),
pickerInput(
inputId = "data_years",
label = "Select Year(s)",
choices = seasons,
selected = seasons,
multiple = TRUE,
options = list(
`actions-box` = TRUE,
`live-search` = TRUE,
`selected-text-format` = "count > 3"
)
)
)
)
Data Menu Item
observe({
input$data_schools %>% glimpse()
})
Reactive raw data
filtered_raw_df <- reactive({
req(input$data_schools, input$data_years, input$var)
df %>%
filter(
school %in% input$data_schools,
year %in% input$data_years,
ip >= input$var[1],
ip <= input$var[2]
)
})
Render table showing raw data loaded for analysis
output$raw_data <- renderDT({
datatable(
filtered_raw_df(),
class = 'cell-border stripe',
options = list(
scrollY = TRUE,
scrollX = "100px",
scrollCollapse = TRUE,
fixedHeader = TRUE,
pageLength = 10)
)
})