title: Creating Radio Buttons that Update based on an Input in R Shiny
body: <p>I'm looking to create a group of radio buttons in a shiny app that will update based on a user input.  Basically, the user will choose a question, and the corresponding answer choices will be the updated options for the radio buttons.  I'm having trouble getting the buttons to update.  Can anyone point me in the right direction?</p>
  
  <p>Very sorry about the formatting, first time using this site.</p>
  
  <p>So far, I have:</p>
  
  <pre><code>questions &lt;- read.csv("~/Answers.csv")
  library(shiny)
  
  
  ui &lt;- fluidPage(
  
    selectInput("numberchoice",label = "Choose an image", choices = c(1:6), 
   selected = 1)
  ,
  imageOutput("image")
  ,
  radioButtons("answerchoice","",choiceNames = c("A","B","C","D","E"), 
  choiceValues = questions[3,2:6])
  
  )
  
  server &lt;- function(input,output,session) {
  answers &lt;- read.csv("~Answers.csv")
  output$image &lt;- renderImage(list(src=
  paste("~",
  input$numberchoice,".png", sep = "")
  ,contentType = "image/png", alt = "Face"),deleteFile = FALSE)
  updateRadioButtons(session,"answerchoice",choices = 
  questions[input$numberchoice,2:5]
  
  
  }
  
  shinyApp(ui = ui, server = server)`
  </code></pre>