title: R Shiny Reactively Display an Image from a list
body: <p>I am trying to reactively display an image from a list in an R shiny application.  </p>
  
  <p>I have many .tiff images stored in the "www" directory of my app.  They follow the naming convention OHC_130.tiff, OHC_131.tiff, OHC_132.tiff, IHC_133.tiff, Deiter_134.tiff, OHC_135.tiff etc...</p>
  
  <p>I also have a vector containing all of these names </p>
  
  <p><code>ImgID_Vector &lt;- as.vector(c("OHC_130", "OHC_131", "OHC_132", "IHC_133", "Deiter_134", "OHC_135")</code></p>
  
  <p>I would like to make a selectable input dropdown list like this where a user can select an image and then click the submit button to make the image appear below. I have set this up for the ui.r but i am not sure how to make it work on the server side. </p>
  
  <pre><code>#ui.r
  library(shiny)
  library(shinydashboard)
  
  dashboardBody(
    tabItems(
      tabItem(tabName = "dt",
            h2("Select an image"),
            fluidRow(
              box(title="This is a searchable database of images", solidHeader = TRUE,status = "primary"),
              selectInput("input$ImageIDVariable1", label = h4("Enter your image of interest"), choices = (ImgID_Vector), multiple = TRUE),
              submitButton("Submit"),
              imageOutput("ImageID_Image")
            )
  )
  )
  </code></pre>
  
  <p>Conceptually I know that on the server side I need to connect the user input from the UI side to the actual image in the "www" folder. I should be able to do this using reactive inputs and renderImage I think.  But I am not sure how to write the render image command to achieve the desired result.</p>
  
  <pre><code>#server.r
  
  #This is the data that contains the choices for the dropdown menu
  ImgID_Vector &lt;- readRDS("ImgID_Vector.RDS")
  
  shinyServer(function(input, output) {
  # This is where I am struggling, with the render image command
  output$ImageID_Image &lt;- renderImage({
      filename &lt;- normalizePath(file.path('./www',
                            paste(input$ImageIDVariable1, '.tiff', sep='')))
      list(src = filename)
    }, deleteFile = FALSE)
  }
  
  #This is where I have the reactive input variable
  ImageIDVariable1 &lt;- reactive({input$ImageIDVariable1})
  
  })
  </code></pre>
  
  <p>Thanks for your help!</p>