Skip to content
Prev 8247 / 63424 Next

Loading packages at startup

On 22 Oct 2002, Timothy H. Keitt wrote:

            
Actually this is a spin-off from a small point in an RFC posted earlier,
and I think it would have been kinder to have done your homework.
A serious proposal is getting sidetracked by half-formulated ways
(even buggy ones) to solve a related but different problem.
Eh?  Only one session is saved and reloaded in .RData per directory.
And we only have one .Rprofile and one .Renviron per directory.
So everyone I have ever seen uses separate directories for separate
projects.

If you go back and read the RFC, you will see the idea was that
users could specify the packages they wanted loaded (and in which order)
on a per-directory basis. *Or not.*  The idea of rewriting it at the end
of a session was just one of the possible extensions.

I would find this very useful, and although I could use .First (prone to
getting damaged) or .Rprofile I would prefer a separate mechanism. Not
least, I would like to use ~/.Rprofile for all my work (turn off
significance stars etc) and a per-directory .Rpackages.
Not possible with S3 methods and loose inheritance. You cannot tell what
package the methods an object needs is in. Nor if it is in several can you
tell which one the user was preferring.  What we can do is to
restore the search list to (more or less) what it was at the end of the
last session, *if we want to*.

Nor is it possible to load packages arbitrarily, as the order does matter.
Again, not possible with S3 classes. I am not sure if it is possible with
formal methods as currently implemented, but it would need that sort of
metadata.