title: how dynamically update html table on shiny app
body: <p>I would like to generate a new html table every time the user changes the parameter "mass" below, and then exhibit it dynamically </p>
  
  <p>server.R</p>
  
  <pre><code>library(hwriter)
  shinyServer(function(input, output) {
  
      output$distPlot &lt;- renderText({
          mass &lt;- as.numeric(input$mass) 
          win &lt;- as.numeric(input$sswin) 
          m1 &lt;- mass-win/2
          m2 &lt;- mass+win/2
  
  
          etr &lt;- paste0("http://rest.kegg.jp/find/compound/", m1, "-", m2, "/exact_mass")
          tb &lt;- read.table(etr)  
          colnames(tb) &lt;- c("id", "mass")
  
          #p &lt;- openPage('test.html')
          tblk &lt;- cbind(paste0("http://www.kegg.jp/dbget-bin/www_bget?", tb[,1]), NA)
          #hwrite(tb, p, link = tblk)
          hwrite(tb, link = tblk)
          #close(p)
  
        })
  
  
  })
  </code></pre>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  
  shinyUI(fluidPage(
  
  
    sidebarLayout(
      sidebarPanel(
  
             textInput("mass", "Mass:", "200.05"),
             textInput("sswin", "Search window:", "0.5")
  
      ),
  
  
      # Show a plot of the generated distribution
      mainPanel(
  
        #plotOutput("distPlot"),
        #includeHTML("test.html")
        uiOutput("distPlot")
  
  
      )
    )
  ))
  </code></pre>
  
  <p>The table is being generated, but I don't know how to update it.</p>
  
  <p>I figured out a way and edited above.</p>