Skip to content
Prev 27032 / 63458 Next

help files for load and related functions

Dear Patrick,

?Firstly, and most importantly, I do not think that your post qualified
for Rd! Please use the correct mail list for such things: R-help. I do
not think anybody on Rd wants mailboxes ?clogged with irrelevant
messages.

Back to your question: it is not clear if you are confused, or your
'user' is confused, but all three help pages look pretty clear and
straight forward to me. Moreover,  I do not see any connection between
attach and library, which you find logical:

- load - the general use of this one is to load external data sets, e.g.
load serialised R object(s) (as the example shows). Until you load, you
cannot use the object as it has no relation to the R session and can be
e.g. a file sitting somewhere on a network

- attach - the general use of this one would be to access elements of a
data set directly, without the data set name specifier and the accessor
operator, such as $, thus as the help page states - it is used to add
the data set to the search path (as the example shows). If you look at
the example, you do not have to call attach to be able to use data, data
could have existed there before and what you effectively get with attach
is a more convenient way of dealing with the data

- library - is used to load *and* attach an R package, which is not
exactly the same as a serialised R object(s), but a full set of other
functionality. Attaching packages is just a part of the loading process,
which occurs basically when the package becomes visible to the user.
Same as with load, you cannot use the package until you load it. There
is not a hint of similarity between loading a package and attaching a
data set as I see it. 

Regards,
Oleg
On Mon, 2007-12-17 at 11:00 +0000, Patrick Burns wrote: