title: Displaying the number of rows in an uploaded data file using R Shiny
body: <p>I am trying to display the number of rows in an uploaded data file. What I am getting as output though is 'data1'. Can somebody assist in getting the number of rows in a data file?</p>
  
  <p><strong>ui.R</strong></p>
  
  <pre><code>library(shiny)
  
  ui = fluidPage(
  sidebarPanel(
  fileInput('file1', 'Choose file to upload',accept =   c('text/csv','text/comma-separated-values','text/tab-separated-values','text/plain','.csv','.tsv')),
  checkboxInput('header', 'Header', TRUE),
  radioButtons('sep', 'Separator',c(Comma=',',Semicolon=';',Tab='\t'),'Comma'),
  radioButtons('quote', 'Quote',c(None='','Double Quote'='"','Single Quote'="'"),'Double Quote'),
  actionButton("Load", "Load the File"),width = 3),
  
  mainPanel(verbatimTextOutput("my_output_data"))
  )
  </code></pre>
  
  <p><strong>server.R</strong></p>
  
  <pre><code>server = function(input, output) {
  
  data1 &lt;- reactive({
  if(input$Load == 0){return()}
  inFile &lt;- input$file1
  if (is.null(inFile)){return(NULL)}
  
  isolate({ 
    input$Load
    my_data &lt;- read.csv(inFile$datapath, header = input$header,sep = input$sep, quote = input$quote,stringsAsFactors =FALSE)
    my_data_size &lt;- nrow(my_data)
  })
  my_data_size
  })
  
  output$my_output_data &lt;- renderPrint({data1})
  
  }
  </code></pre>