title: R Shiny where to place withProgress
body: <p>On my Shiny page, there is a step reading a big log file, which takes 25s to load. I would like to show a progress bar after user clicks a button. Otherwise they may think it is not working while they are waiting.</p>
  
  <pre><code> #ui.R
   #I have an actionButton to activate reading the log file
   actionButton("getLog","Get Log data")
  
   #server.R
     observeEvent(input$getLog, {
   nL = as.numeric(countLines("/script/cronlog.log"))
   Log = read.table("/script/cronlog.log",sep = ";",skip = nL-1000)
   LogFile = tail(Log,100)
   colnames(LogFile) = "cronlog"
   })
  </code></pre>
  
  <p>I was trying to use withProgress but I don't know how to use it to wrap the codes. I tried something like this:</p>
  
  <pre><code>  observeEvent(input$getLog, {
  withProgress(message = 'Calculation in progress',
                                detail = 'This may take a while...', value = 0, {
                     for (i in 1:60) {
                       incProgress(1/60)
                       Sys.sleep(0.25)
                     }
                   })
  nL = as.numeric(countLines("/script/cronlog.log"))
  Log = read.table("/script/cronlog.log",sep = ";",skip = nL-1000)
  LogFile = tail(Log,100)
  colnames(LogFile) = "cronlog"
  })
  </code></pre>
  
  <p>The progress bar did show up but it seems like the loading progress is running after the progress bar, which makes the process even longer. I guess I didn't wrap the code correctly. </p>
  
  <p>Any suggestions?</p>
  
  <p>Thank you in advance!</p>