[R] avoiding reinstall already installed *package*

(Ted Harding) Ted.Harding at manchester.ac.uk
Tue May 18 19:03:48 CEST 2010


On 18-May-10 16:42:40, Peter Ehlers wrote:
> On 2010-05-18 10:05, (Ted Harding) wrote:
>> On 18-May-10 15:49:37, Martin Maechler wrote:
>>> { I've modified the subject; I can't stand it hitting square into
>>>    my face ... }
>>>>>>>> "mr" == milton ruser<milton.ruser at gmail.com>
>>>>>>>>      on Tue, 18 May 2010 12:36:23 -0300 writes:
>>>      mr>  Dear R-experts,
>>>      mr>  I am installing new libraries using
>>>      mr>  install.packages("ggplot2",dependencies=T).
>>>      mr>  But I perceive that many dependencies are already
>>>      installed.
>>>      mr>  As I am using a low-band internet, how can avoid reinstall
>>>      mr>  installed libraries?
>>>
>>> There's no problem with installed libraries, as ...
>>> they DO NOT EXIST.
>>>
>>> These are *PACKAGES* !
>>> Why do you think are you talking about the function
>>>
>>>   install.packages()  ????
>>>           ^^^^^^^^
>>
>> Ah, Martin! I know that "package" is the official terminology,
>> but R itself tempts the naive user into deviating from the
>> True Path. Indeed, I had my fingers burned by this myself,
>> a long time ago (I'm still licking them ... ).
>>
>> One might ask: "Why do you think we use the function library()?"
>> when loading add-on packages into R. Indeed, the very directory
>> tree of R itself stores packages under /usr/lib/R/library.
>>
>> So, once in a while, someone gets it wrong, and has to find it
>> out the hard way!
> 
> Well, I don't know if I've ever disagreed with Ted before,
> but here I would (somewhat) disagree. It seems a bit odd that
> nobody confuses 'book' with 'library', yet the package/library
> problem is persistent. It may have something to do with the
> use of 'library' in other computer languages.
> 
> Anyway, not long ago there was a suggestion (Rolf Turner's?)
> to rename the library() function to something like use(),
> but, as I recall, a number of nontrivial objections were
> raised.
> 
> Of course R stores packages in libraries. That's were books
> *should* reside. And it's a good idea to have Martin remind
> us now and again that books themselves are not libraries.
> 
> But I must confess that I'm no longer much bothered by the
> misuse. If it ever leads someone astray in their code, then,
> well, they have only themselves to blame.
> 
> Cheers,
> Peter Ehlers

Well, I don't think you're disagreeing with me, Peter!
My point (which you're not disputing) is that the naive user
will think "library" because of using the function library().
Perhaps my remark about /usr/lib/R/library was a bit superfluous
(and indeed that path supports your "book" vs "library" point).
Nevertheless, it would still reinforce users who think "library".

I suppose, to take your analogy, the semantics of, say,
library(Hmisc) could be spelled out as "Go to the library
and take out the book called Hmisc". On the other hand, the
naive user will tend to read it as "get library Hmisc".

While "library" is conspicuous to all users because of the
function, the fact that packages should be called packages does
not jump out into your face (until someone on the list does).

That said, I again agree with you that I'm not much bothered
by the question. I see it as one of the various little things
in R which one happily learns (in the end ... ) to live with!

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 18-May-10                                       Time: 18:03:45
------------------------------ XFMail ------------------------------



More information about the R-help mailing list