title: Shiny widget to change the order of elements in a vector
body: <p>On quite a few websites you have a drag and drop interface to change the order of elements in a list. I am looking for something similar in Shiny. I want the user to be able to drag and drop elements of a list to change the priority by changing the order.</p>
  
  <p>Right now I have a solution that abuses <code>selectizeInput()</code>. This works, but it quickly becomes cumbersome when the list of choices becomes larger.</p>
  
  <p>An illustration:</p>
  
  <pre><code>library(shiny)
  
  shinyApp(
    ui = shinyUI({
      fluidPage(
        title = "Example for ordering objects",
        sidebarLayout(
          sidebarPanel(uiOutput("selection"),
                       actionButton('update',"Update")),
          mainPanel(
            helpText('The order of elements'),
            tableOutput('theorder')
          )
        )
      )
    }),
    server = function(input, output, session) {
      values &lt;- reactiveValues(x = c('Item1','Item2','Item3'))
  
      output$selection &lt;- renderUI({
        selectizeInput('neworder',
                       'Select new order',
                       choices = values$x,
                       multiple = TRUE)
      })
  
      output$theorder &lt;- renderTable(
        values$x
      )
  
      observeEvent(input$update,{
        id &lt;- values$x %in% input$neworder
        values$x &lt;- c(input$neworder, values$x[!id])
      })
    }
  )
  </code></pre>
  
  <p>Downside: To change the order at the end of the list, the user has to select the entire list in the correct order. One mistake and he has to start all over again.</p>
  
  <p>Wishlist: a Shiny widget (possibly from another package), preferably drag and drop, that can make this kind of action more convenient.</p>