title: Use progressBar of R shiny within a function
body: <p>Using progressbar in R shiny is quite straightforward when it comes within the server function :</p>
  
  <pre><code>library(shiny)
  source(myFunctions.R)
  
  shinyServer(function(input, output) {
  
  withProgress(message = 'Chargement des données', value = 0, {
  incProgress(0.5)
  function1()
  incProgress(0.6)
  function2()
  incProgress(0.7)
  function3()
  incProgress(0.8)
  })
  })
  </code></pre>
  
  <p>But what if I want to have them inside a function, for instance:</p>
  
  <pre><code>Allfunction &lt;- function(){
  withProgress(message = 'Chargement des données', value = 0, {
  incProgress(0.5)
  function1()
  incProgress(0.6)
  function2()
  incProgress(0.7)
  function3()
  incProgress(0.8)
  })
  }
  </code></pre>
  
  <p>and hence</p>
  
  <pre><code>shinyServer(function(input, output) {
  Allfunction()
  })
  </code></pre>
  
  <p>Then I get </p>
  
  <pre><code>Warning: Error in withProgress: 'session' is not a ShinySession object.
  </code></pre>
  
  <p>and adding a session argument to the function, as advertised on a google forum did'nt do it.</p>