title: Change temporary directory
body: <p>I am using R on windows and need to change the temporary directory where tmp files are stored. </p>
  
  <p>I checked a few answers, here, in R-help, etc., but no one is working.</p>
  
  <p>Some links I tried: <a href="https://stackoverflow.com/questions/10322451/change-tempdir-in-session-update-r-tempdir">here</a>, <a href="http://r.789695.n4.nabble.com/How-do-I-set-the-Windows-temporary-directory-in-R-td876483.html" rel="noreferrer">here</a>, and <a href="http://r.789695.n4.nabble.com/Cannot-change-location-of-tempdir-td4456159.html" rel="noreferrer">here</a>.</p>
  
  <p>After trying those answers (I have to say that I do not get exactly the point on them), 
  <code>tempdir()</code> still is the default, as much as I try different ways. </p>
  
  <p>Can anybody can give a detailed example procedure of how to do this? </p>
  
  <p>My session Info: </p>
  
  <pre><code>R version 2.15.2 (2012-10-26)
  Platform: i386-w64-mingw32/i386 (32-bit)
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  loaded via a namespace (and not attached):
  [1] tools_2.15.2
  </code></pre>