Skip to content
Prev 8246 / 63421 Next

Loading packages at startup

[Sorry, just noticed this thread and don't know what's been said
already, but I will comment nonetheless.]

I've also thought about this problem and I think we should be careful to
make sure its solved in a very general manner. Objects bind methods to
data, but this is broken when saving and reloading R sessions (only the
data ends up in .RData and not the bindings). What happens if someone
has multiple saved R sessions in a single directory? A single .Rpackages
file would either leave out packages or have to include all packages
across all sessions. I would far rather have a mechanism that recognizes
an object as an object and lets that object load the appropriate
bindings to methods at (re)instantiation. I once proposed that there be
function hooks in the save/load process that could be overloaded by
object type to make sure that any initializations (including package
loading) could be completed before attaching the data. This would also
allow for example database objects to reestablish their connections when
a session is reloaded from disk.

Tim
On Tue, 2002-10-22 at 06:46, Warnes, Gregory R wrote: