I am an infrequent Windows users, so I am not sure where this setting arises, but it seems that the default directory for R packages for a user (and the value of R_USER
env variable) ends up being the Documents folder inside the OneDrive folder of the user. In the past, I seem to recall it being the local drive Documents folder, which seems much more sensible.
Why does R end up using this folder? Where is the setting that determines this? I presume it is Windows setting, as opposed to a R setting?
Basically I want to choose another folder such as the Documents folder on the local drive rather than the OneDrive Documents folder.
This page How to fix RStudio’s package installation on Windows 10 | by José Duarte, PhD | Medium gives one solution, but that involves hardcoding the folder path into a R system wide settings file that previously read environment variables. Presumably, the better solution is to change either the environment variable value itself, or change whatever sets the default value of the environment variable.
Does any Windows based R/RStudio user have any solutions to this problem?