I have a "copy deployed" installation of R with no R-specific environment variables set.
I want to source a file from within Rprofile.site
:
source("how/to/find/this/file/my_settings.R")
Where could I place my my_settings.R
file so that it can be found from within Rprofile.site
no matter in which path Rprofile.site
is installed?
BTW: I want to avoid an absolute path to my_settings.R
this would work indeed. I'd prefer to use the same folder as Rprofile.site
or a path relative to it to support copy deployment of R.
Edit 1: The problem is that getwd
is always different depending on the current folder from which you start R