title: How to link data table and bar charts in R shiny
body: <p>I'm trying to make a dashboard where my data have around 7-8 columns and 1500-2000 entries. There are two columns which are numeric on which I want to do summation. Rest of the columns I want to use for slicing the data(creating subset by adding filters or slicing it according to entries of other columns).</p>
  
  <p>I wanted to make dashboard where anyone can create bar charts or summary tables on the go. I was able to achieve this using <code>rpivottable</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/rClsD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rClsD.png" alt="Charts using rpivottable"></a>
  My second step is to show data that is being mapped in those charts. This won't make much sense if chart is at a basic level i.e <em>1.5k-2k entries</em> but as i slice the data further and further based on filters from rest of the columns. I'll come to a point where only 80 or 100 rows are satisfying a list of filters. I want to show these rows in the shiny dashboard itself.</p>
  
  <p>I'm using this code to create below dashboard but the data is all the data that I have read.</p>
  
  <pre><code> library(shiny)
   library(DT)
   library(rpivotTable)
  
    data &lt;-read.csv("Book1.csv")
  
   ui =  fluidPage(
  rpivotTableOutput("test"),DT::dataTableOutput('table'))
  
  server = function(input, output) {
    output$test &lt;- renderRpivotTable({
    rpivotTable(data = data)          })
  
    output$table &lt;- renderDataTable(
      data, options = list(
        pageLength = 100
  
      )
    )
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xwdLh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xwdLh.png" alt="Charts and Data table"></a></p>
  
  <p>I'm able to create the charts and table using <code>rpivottable</code> and <code>DT</code> package but is there a way to link both of these ? Since Data table now is simply showing all the data that was read originally.</p>
  
  <p>As in, If I want to see data that constitutes the orange bar in second picture and i click on the orange bar is there a way for the table to show data that make up the orange bar?</p>