User Library on Windows 10

Hi,

I would like to set up a user library in Windows. In Linux, RStudio shows the User Library and the System Library in the Packages pane. However, I was not able to obtain the same in Windows.
This is what I have done:

  1. First I created the default folder for the user library with:
    dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
  2. Restarted R

After that, if I run .libPats(), the first path is the one of the user library and if I install a package it goes in the right folder.

However, RStudio doesn't show User Library in the Packages pane and the new installed package appears in the System Library.

Is there a way to fix this? I've google the problem but I didn't find any solution that worked.

I have R 4.2.1 and RStudio 2022.07.1

Sergio

Playing around, I discovered that if I change the default location of the user library by setting it in the .Renviron file (for example in the Documents folder), RStudio shows it properly in the Packages pane.

So it looks like RStudio doesn't scan the default location, that is:

C:/Users/${USERNAME}/AppData/Local/R/win-library/%v

Any idea?

Sergio

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.