I am working with several projects in Rstudio that require different .Rprofile files. These files usually consist of two parts: global settings I'd like to have every time I run R and local project-specific settings that are loaded when I open the project.
It is natural to exclude the global part from local .Rprofiles to keep it flexible. However, the relevant topic in the documentation states the following (backed up by this question):
When starting RStudio in an alternate working directory the .Rprofile file located within that directory is sourced. If (and only if) there is not an .Rprofile file in the alternate directory then the global default profile (e.g. ~/.Rprofile) is sourced instead.
How do I force to load the global .Rprofile at all times?
Small example. I currently have 2 .Rprofiles:
cat("global\n"); cat("local_1\n)for project 1;cat("global\n"); cat("local_2\n)for project 2;- The global
.Rprofiledoes not exist.
I'd like to have 3 of them:
cat("local_1\n)for project 1;cat("local_2\n)for project 2;cat("global\n")at the home dir.
How should I tinker with these files and/or Rstudio options to get the same output on startup of both projects?