title: How to run a function that gets data from inside eventReactive and plot in table?
body: <p>I'm very new to shiny and am having some trouble and have been searching all day, so hopefully someone can help me.  Once an action button (actionButton, on UI) is selected by a user, I would like the server script to call a function (evenReactive in server) I wrote (myfunction, see below) that uses the input items from the UI and gets the right parameters I need to run myfunction and produce a n X2 data matrix that will be plotted as a table (renderTable in server, below). The data is a n X 2 matrix.</p>
  
  <p>I have some sample code below. It's not the entre code, so you will not see the UI with the inputs I am putting in my function, or the server parts associated. But, it is the part I am trying to fix. I hope that's ok. I don't need the renderText, but when I take it out I get an error.  Sorry for the formatting. Copy and pasting changed it a bit.</p>
  
  <pre><code>library(shiny)
  
  ui &lt;- shinyUI(fluidPage
       (column(4,actionButton("gobutton", "Run"),verbatimTextOutput("ntext1")), 
        column(4, DT::dataTableOutput("table",width = "75%"))))
  
  library(shiny)
  
  shinyServer(function(input, output, session) 
  
  
    ntext1 &lt;- eventReactive(input$gobutton, {
              if (input$gobutton==1){ 
                data=myfunction(input$checkbox,input$dateRange)}
     })
  
  
    output$ntext1 &lt;- renderText({ntext1()})
  
    output$table &lt;- DT::renderDataTable(DT::datatable({
      data
    })
  ))
  
  myfunction &lt;-function(All,date1,date2,source_cd,tran_cd,airline_list,mag_level) {
   print(All); print(date1); print(date2); print(source_cd);print(tran_cd);print(airline_list);print(mag_level)
  
      setwd("C:/Users/TRomano/Documents/Projects/TrendAnalysis/Data")
      data = read.csv("Airlines.csv",header = TRUE)
      return(data)
    }
  </code></pre>