Skip to content
Prev 12375 / 63461 Next

Execute function at startup

On Wed, 14 Apr 2004 09:17:56 +1000, <Mark.Bravington@csiro.au> wrote :
I forget whether Erich mentioned it in this post, but in other
messages he's told me that the intention is to use this as a way to
start R for naive users, immediately firing up Rcmdr for instance.
It's possible to install a .First function for such users, but it
would be easier if the capability was built in.
I think you're right about this.
I don't think it's really that bad:  a lot of those are things of
interest only to package writers.  Users only need to worry about

Rprofile.site
.Rprofile

(which are sourced in that order), just before 

.Rdata

is loaded.  Then the functions

.First
base::.First.sys

are executed.  I think the main thing wrong with the current scheme is
that those last two functions are in the wrong order:  the
user-defined .First should come last.

Adding one more thing to the list (executing a command specified on
the command line) seems reasonable to me.

Duncan Murdoch