title: Edit datatable in Shiny with dropdown selection for factor variables
body: <p>I am trying to create a Shiny app that allows users to edit a datatable, whereby the edits are saved. Here is a minimal example:</p>
  
  <pre><code>library(shiny)
  library(DT)
  
  ui &lt;- fluidPage(
    DT::DTOutput('df')
  )
  
  server &lt;- function(session, input, output){
    df &lt;- data.frame(x = factor(c("A", "B", "C"), levels = c("A", "B", "C")))
    output$df &lt;- DT::renderDT(df,
                          editable = T)
  
    proxy &lt;- dataTableProxy("df")
  
    observeEvent(input$df_cell_edit, {
      info &lt;- input$df_cell_edit
      str(info)
      i &lt;- info$row
      j &lt;-  info$col
      v &lt;- info$value
      df[i, j] &lt;&lt;- DT:::coerceValue(v, df[i, j])
      replaceData(proxy, df, resetPaging = FALSE)
  
    })
  }
  
  shinyApp(ui, server)
  </code></pre>
  
  <p>This allows me to edit the values of <code>x</code> in-line, but since <code>x</code> is a factor, I'd like to restrict the values that the user is able to input. Ideally, I would like this to be accomplished using a drop-down menu. Is this functionality possible using DT::datatable and Shiny?</p>
  
  <p><em>Note:</em> I know of the <code>rhandsontable</code> package, however I would prefer to use DT if possible.</p>