title: How to use the download button in Shiny?
body: <p>I want to download a <code>csv</code> file using the download button in Shiny. The file would be created using the parameters from a secondary r script.</p>
  
  <pre><code>    ###SERVER
      output$downloadData &lt;- downloadHandler({
      filename = function() {
          paste('data-', Sys.Date(), '.csv', sep='')
        }
        content = function(file) {
          csv_write&lt;-array(0,dim=c(length(GHI_D),15))
          csv_write&lt;-cbind(GHI_Data$timeStamp,GHI_D,POA_OBS_T,POA_model_T,POA_model_FT,POA_OBS,DNI_model,DHI,tracking_angle,incidence_angel_T,Backtracking_angle,SunAz,SunEl,Kt,DNI,DDNI,incidence_angel,DHI_model,DHI_model_T,Eb,Eb_T)
          write.csv(csv_write,row.names=FALSE, na="")
          write.csv(csv_write,row.names=FALSE, na="")
        }
    })
      ### UI
            downloadButton('downloadData', 'Download CSV Report', style="display: block; margin: 0 auto; width: 230px;color: black;")
  </code></pre>