0

I am trying to install packages for a spatial data course however each package I try install to R I get this same error message

Warning in install.packages :
  'lib = "C:/Users/chris/OneDrive/Documents/R/win-library/3.4"' is not writable

I have made a folder under R in documents for 3.4.

I also get this error message;

cannot create dir 'C:\Users\chris\OneDrive\Documents\R\win-library\3.4\file2d1c49893057', reason 'No such file or directory'
Error in install.packages : unable to create temporary directory ‘C:\Users\chris\OneDrive\Documents\R\win-library\3.4\file2d1c49893057’

I don't understand whether I have to create a new directory before I install an R package or if I have a setting that prevents it from being able to install packages?

I have installed packages before/had R for 2 years and never had this issue....

chris1
  • 11
  • 3
  • it seems R is unable to make a temporary directory? why could this be? – chris1 Sep 06 '20 at 15:46
  • I've now deinstalled R 3.4. have R 3.6. which has worked before and yet I still have these issues – chris1 Sep 06 '20 at 15:53
  • This discussion might be of help: https://community.rstudio.com/t/error-after-r-update-lib-c-program-files-r-r-3-5-0-library-is-not-writable/7947/2 -- in particular, if you're using Windows, have you tried running RStudio as an administrator? – Aaron Montgomery Sep 06 '20 at 16:39
  • I discourage the use of R or RStudio as administrator, it's kicking the problem into the wrong corner. It's more likely that you have either protected directories (anti-malware) or controlled-folder-access. However ... ultimately, I believe it is better to install packages into a non-OneDrive folder and then copy in after done. See https://stackoverflow.com/a/59814948/3358272 for one way to do this. – r2evans Sep 06 '20 at 22:21
  • Thank you I had an issue with my permissions and the issue is now solved – chris1 Sep 07 '20 at 14:31

0 Answers0