В приведенном ниже фрагменте кода из моего RMarkdown
\ flexdashboard
кода с shiny
мне нужно изменить choices
для второй функции selectInput()
на основе выбора, сделанного в первом selectInput()
функция.
selectInput('theme', 'Select theme:',
choices = c(dtThemes$Theme %>% unique()))
selectInput('question', 'Select Question:',
choices = c(dtQuestions$Question %>% unique())) # This works
#choices = strQuestions) # This does not work
strQuestions <- reactive({
nQuestions <- dtThemes[Theme == input$theme, Q2018]
dtQuestions[nQuestion %in% nQuestions, strQuestion]
})
Как мне это сделать?
Инкапсуляция кода в renderUI()
не помогла:
renderUI({
selectInput('question', 'Select Question:',
strQuestions(), width="100%")
})