I have a Macintosh and I am trying to automatically load packages, homemade functions, and use modified setting every time I start R. I believe this can be done with a file call
Over the years I have come to rely on the help(Startup)
documentation as the best place to read up on this. There are numerous per-user and per-site configuration file as is customary for rich applications. It may seem like overkill at first but it is a really good system. And once you grok Renviron
versus Renviron.site
and dito for Rprofile
, you appreciate the consistent behaviour across platforms.
If you run getwd()
, then you will see your R startup directory. On a mac it is typically /User/login_name
That is where I leave my .RProfile
where I load custom functions and also frequently used packages.
Also see: Useful little functions in R (to put in your .RProfile) and Expert R users, what's in your .Rprofile?…
Michael, I too have found this topic to be a bit confusing. I'm on a Mac as well. I created an "Rprofile" file which has all my customizations in it. Here's how mine works (I don't think there is anything special about my set up):
HTH Bryan