title: Different results even with set.seed() in R
body: <p>I have re-run with the same seed but cannot produce same results in R studio.</p>
  
  <p>Will set.seed() lose track when calling different user packages, R6 classes and methods?</p>
  
  <p>Have you come across similar situation and how to fix it?</p>
  
  <p>Thanks a lot</p>
  
  <pre><code>closeAllConnections()
  rm(list=ls())
  gc()
  
  set.seed(123456)
  require(PackageA)  #user defined package
  
  fileName &lt;- "N:/Risk Management/abc.json";
  
  configuration &lt;- JsonConfigurationReader$readConfiguration(fileName); #R6 class and method in PackageA
  
  instance &lt;- someClass$new(configuration); #R6 class and method in PackageA
  
  instance$execute()  #will produce some random numbers in this method
  
  closeAllConnections()
  rm(list=ls())
  gc()
  </code></pre>