Installing RStudio - location win-library

Hi,
I have a new laptop and installed R, Rstudio and Rtools again. Mainly using Rstudio.
When I install packages a lot of files appear in my onedrive.
I guess because fo these environment variables:
R_LIBS_USER C:/Users/mjvdh/OneDrive/Documents/R/win-library/4.0
R_USER C:/Users/mjvdh/OneDrive/Documents

I tried to create a .Renviron in the Rstudio directory, but apparently this file is not being picked up / or this is not the way to change these directories
R_LIBS_USER C:/Users/mjvdh/R/win-library/4.0
R_USER C:/Users/mjvdh

Any ideas on how to resolve this - basically I dont want to have all these files in my One Drive (I just keep Word/Excel files there).

Greetings
Maarten

You can change the default library folder by setting your R_LIBS_SITE environmental variable on a .Reviron or .Rprofile file

# In a .Renviron file you can set it by adding this line
R_LIBS_SITE="C:\\Program Files\\R\\R-4.0.3\\library"

For a more detailed explanation, you can read this blog post

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.