0

I have just redownloaded R and R-studio on a new computer after my old one broke (exact same computer, OS and specs). I am trying to run a script that I have previously created, but when I try to install the packages I get a warning message and an error

Warning in readLines(file, skipNul = TRUE) :
  cannot open file 'C:/Users/me/OneDrive/Documents/R/win-library/4.0/nlme/DESCRIPTION': probable reason 'No such file or directory'
Warning in readLines(file, skipNul = TRUE) :
  cannot open compressed file 'C:/Users/me/OneDrive/Documents/R/win-library/4.0/nnet/DESCRIPTION', probable reason 'No such file or directory'

On looking it little further I see that the folders nlme and nnet do not have a file DESCRIPTION in them. I am not sure why the packages won't install as I have never had issues, though I feel it has something to do with the path being in onedrive. I am unsure, however, 1. how to switch my path and 2. what I should switch my path to.

JVDeasyas123
  • 263
  • 3
  • 14
  • It's difficult to troubleshoot these issues which are often due to your local configuration. Some ideas: the OneDrive path is a good suspect - does that path exist on the new machine? What does `.libPaths()` return? Have you ever created a `.Renviron` file with a path for `R_LIBS_USER` ? – neilfws Feb 15 '21 at 04:05
  • `.libPaths` shows my path to be "C:/Users/me/OneDrive/Documents/R/win-library/4.0", which does exist on this machine. And I have never created a `.Reviron` file – JVDeasyas123 Feb 15 '21 at 04:17
  • I've seen issues that Installing on onedrive can cause issues. In short install the package locally – user20650 Feb 15 '21 at 14:08
  • see https://stackoverflow.com/questions/56468370/how-to-get-r-to-stop-downloading-r-packages-to-onedrive?noredirect=1&lq=1 – user20650 Feb 15 '21 at 14:09

1 Answers1

1

Thank you everyone for your answers. This medium article fixed my problem exactly. In short, I just needed to change R base code so that it would save new packages to my local drive instead of one drive.

https://medium.com/@ValidScience/how-to-fix-rstudios-package-installation-on-windows-10-c1e602bf3a1f

JVDeasyas123
  • 263
  • 3
  • 14