title: How to do nested selections selectInput() in RMarkdown with Shiny?
body: <p>In a snippet of code below from my <code>RMarkdown</code> \ <code>flexdashboard</code> code with <code>shiny</code> , I need to modify the <code>choices</code> for the second <code>selectInput()</code> function, based on the selection made at the first <code>selectInput()</code> function. </p>
  
  <pre><code>selectInput('theme', 'Select theme:',
              choices = c(dtThemes$Theme %&gt;% unique()))  
  
  selectInput('question', 'Select Question:', 
              choices = c(dtQuestions$Question %&gt;% unique())) # This works
              #choices = strQuestions)  # This does not work
  
  strQuestions &lt;- reactive({
      nQuestions &lt;- dtThemes[Theme == input$theme, Q2018]
      dtQuestions[nQuestion %in% nQuestions, strQuestion]
  })
  </code></pre>
  
  <p>How do I do that?    </p>
  
  <p>Encapsulating code in<code>renderUI()</code> did not help:</p>
  
  <pre><code>  renderUI({
      selectInput('question', 'Select Question:', 
                  strQuestions(), width="100%") 
    })
  </code></pre>