title: Why do I get a "failed to lock directory" error when installing packages on my work laptop
body: <p>I've recently installed R + Rstudio on my work-laptop and now I'm trying to install packages. I have full authorisation in the map that I'm downloading the packages to. However, I keep on getting the following error:</p>
  
  <pre><code>    Error in install.packages : ERROR: failed to lock directory                         
      ‘\\hltfs001\Home$\jolien.jansen\Documents\R\win-library\3.6’ for 
      modifying. Try removing 
      ‘\\hltfs001\Home$\jolien.jansen\Documents\R\win-library\3.6/00LOCK’
  </code></pre>
  
  <p>This error is accompanied by this error:</p>
  
  <pre><code>     Warning in install.packages :
       'lib = "\\hltfs001/Home$/jolien.jansen/Documents/R/win-library/3.6"' 
       is not writable
  </code></pre>
  
  <p>I've tried to install the packages in a different folder, which I'm also authorised to do, but that did not solve the issue. </p>
  
  <p>I've googled the error and that gave me a couple of things to try. </p>
  
  <p>At first I tried manually removing the LOCK folder, and restarting R. That did not help</p>
  
  <p>Then I tried this code:</p>
  
  <pre><code>    unlink("/hltfs001/Home$/jolien.jansen/Documents/R/win- 
      library/3.6/00LOCK", recursive = TRUE)
  </code></pre>
  
  <p>Which again removed the LOCK folder, but didn't help with the error either</p>
  
  <p>Finally I tried:</p>
  
  <pre><code>    install.packages("Rcpp", dependencies=TRUE, INSTALL_opts = c('--no- 
      lock'))
  </code></pre>
  
  <p>But again, that gave me the same error.</p>