title: Adding radiobutton to select a DataTable row in Shiny
body: <p>I need to add radiButtons to select rows in Data, i.e. the radiobutton choosen should be passed to input.
  I cannot use built in row selection in DT. I really need to use radiobuttons to select the row.
  This is what is wanted: <a href="https://i.stack.imgur.com/o6wqN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o6wqN.png" alt="wanted result for rows selection"></a></p>
  
  <p>Using <a href="https://yihui.shinyapps.io/DT-radio/" rel="nofollow noreferrer">https://yihui.shinyapps.io/DT-radio/</a> I am able to select COLUMNS.
  Es:</p>
  
  <pre><code>library(shiny)
  library(DT)
  shinyApp(
  ui = fluidPage(
  title = 'Radio buttons in a table',
  DT::dataTableOutput('foo'),
  verbatimTextOutput("test")
  ),
  server = function(input, output, session) {
  m = matrix(
    c(round(rnorm(24),1), rep(3,12)), nrow = 12, ncol = 3, byrow = F,
    dimnames = list(month.abb, LETTERS[1:3])
  )
  for (i in seq_len(nrow(m))) {
    m[i, 3] = sprintf(
      if_else(i == 1,
              '&lt;input type="radio" name="%s" value="%s" checked="checked"/&gt;',
              '&lt;input type="radio" name="%s" value="%s"/&gt;'),
      "C", month.abb[i]
    )
  }
  m=t(m)
  
  output$foo = DT::renderDataTable(
    m, escape = FALSE, selection = 'none', server = FALSE,
    options = list(dom = 't', paging = FALSE, ordering = FALSE),
    callback = JS("table.rows().every(function() {
        var $this = $(this.node());
                  $this.attr('id', this.data()[0]);
                  $this.addClass('shiny-input-radiogroup');
   });
                  Shiny.unbindAll(table.table().node());
                  Shiny.bindAll(table.table().node());")
   )
  output$test &lt;- renderPrint(str(input$C))
  }
  )
  </code></pre>
  
  <p>The result is: <a href="https://i.stack.imgur.com/EqpZc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EqpZc.png" alt="partial result for columns selection"></a></p>
  
  <p>Naively, I tried to remove m=t(m) and changing rows to columns in the callback. This is not working because the callback function in the example is adding class and id to the last , which have no counterpart for column.</p>
  
  <p>Any idea?</p>