0

I started a course and I managed to download RStudio and to install the package the teacher asked. However, I'm unable to install anything else. I've tried several tips from other asks I saw, but the problem seems to be where it's being installed and not much of a question of CRAN. Here's what happened:

>Error in install.packages : cannot open file 'C:/Users/Anabe/OneDrive/Documentos/R/win-library/4.1/file2910537661eb/stringfish/icelandic_words_500_utf8.txt': Permission denied

I managed to run R as administrator and two packages that weren't being installed before were installed. I do hope everything is going to work now. Thank you so much for your help. I can't wait to learn more R :)

Ana
  • 1
  • 1
  • 1
    Welcome to SO! A suggestion to improve your question is to delete the unneeded information. The actual error is buried in a sea of messages printed out during installation. It looks like a permission issue. Does [this](https://stackoverflow.com/questions/42807247/installing-package-cannot-open-file-permission-denied) help? – cazman Jan 24 '22 at 21:26
  • Rerun RStudio as admin? Go to `R_Home` (Probably in documents) and delete packages in R that have the word `LOCK` at the end then try again. – NelsonGon Jan 24 '22 at 21:35
  • 2
    I've seen so many problems with users trying to both maintain (minor) packages but more important install (major) onto OneDrive. Refs: https://medium.com/@ValidScience/how-to-fix-rstudios-package-installation-on-windows-10-c1e602bf3a1f and so many other questions found by searching for `"r" "onedrive" "install.packages"` (quotes are meaningful). I suggest either or both of: (1) change your default lib path for installing packages, see `?.libPaths` and https://stackoverflow.com/q/65943714/3358272; (2) try [`with_local_libpath`](https://stackoverflow.com/a/59814948/3358272) or similar methods. – r2evans Jan 24 '22 at 21:46
  • @cazman Thank you, I wasn't sure of what the problem was at that point. I managed to run R as administrator and created a new folder (library) but when I go to "Install Packages" and click on the folder, there's only the default one available, even though when I open Documents, I can access that other library folder I created. – Ana Jan 25 '22 at 23:15
  • @NelsonGon I couldn't find any package with LOCK. Is that good or bad haha? – Ana Jan 25 '22 at 23:16

0 Answers0