1

Whenever I run RStudio and want to install packages, it gives me that: "Would you like to use your personal library instead?". If I pick "yes", it suggests me to create a personal library in my working directory. And then it fails to install:

Warning in install.packages : cannot create dir 'C:\Users\Name.Name-Name\OneDrive - ??? ?????? ????? ?????????', reason 'Invalid argument' Error in install.packages : unable to create ‘C:/Users/Name.Name-name/OneDrive - ??? ?????? ????? ?????????/?????????/R/win-library/3.6’

When I run my R as administrator, packages install.

I have a Windows 10 OS, the source directory of my R and RStudio is "C\ProgrammFiles"

This problem has begun when I started using OneDrive service (as our uni provides us with 1 TB of cloud in OneDrive). Then I got really annoyed by OneDrive and deleted it. But the problem remained.

P. S.: I do not want always running RStudio as administrator — it takes a long time. P. P. S.: "?????" in the error message is Cyrillic letters. I don't think that they are the cause of this particular problem because as administrator permission it works...

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
rg4s
  • 811
  • 5
  • 22
  • (1) In R, backslashes (such as directories/paths) must be doubled, as in `c:\\Users\\Name.Name-Name\\...`. Alternatively, every OS (including windows) can use forward slashes, so `c:/Users/Name.Name-Name/...` will work equally well. (2) This might be "old information", but on Windows I have historically had a litany of difficult-to-troubleshoot problems when important paths have spaces in directory names (no problem on linux). For this reason, I always avoid spaces in the path, going so far as to install R *not* in `c:/Program Files/`. – r2evans Sep 17 '19 at 18:57
  • 1
    This is about R, though, not the RStudio IDE (even if that's the only way you'll be accessing the R programming language), so I've removed the [tag:rstudio] tag. If this is incorrect, my apologies, but it does not seem to be an IDE-related issue. – r2evans Sep 17 '19 at 18:58
  • Please see https://stackoverflow.com/questions/35952408/i-am-unable-to-install-packages-in-r https://stackoverflow.com/questions/31018358/make-a-file-writable-in-order-to-add-new-packages and finally try to fiddle with `.libPaths`: https://stackoverflow.com/questions/15170399/change-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work – Roman Luštrik Sep 17 '19 at 19:08

0 Answers0