avoiding reinstall already installed library

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

avoiding reinstall already installed library

milton ruser
Dear R-experts,

I am installing new libraries using
install.packages("ggplot2",dependencies=T).
But I perceive that many dependencies are already installed. As I am using
a low-band internet, how can avoid reinstall installed libraries?

cheers

milton

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed library

Steve Lianoglou-6
Hi,

On Tue, May 18, 2010 at 11:36 AM, milton ruser <[hidden email]> wrote:
> Dear R-experts,
>
> I am installing new libraries using
> install.packages("ggplot2",dependencies=T).
> But I perceive that many dependencies are already installed. As I am using
> a low-band internet, how can avoid reinstall installed libraries?

Look at the description of the "dependencies" argument in the
?instal.packages help:

"""logical indicating to also install uninstalled packages on which
these packages ..."""

It looks like your concern is already taken care of.

-steve
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

Martin Maechler
In reply to this post by milton ruser
{ I've modified the subject; I can't stand it hitting square into
  my face ... }

>>>>> "mr" == milton ruser <[hidden email]>
>>>>>     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. As I am using
    mr> a low-band internet, how can avoid reinstall 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()  ????
         ^^^^^^^^

---
To answer the question you did want to ask:

Do not be afraid:  Depedencies are only installed when needed,
i.e., no package will be downloaded and installed if it already
is there.

Martin Maechler, ETH Zurich

    mr> cheers

    mr> milton

    mr> [[alternative HTML version deleted]]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(another thing you should learn to avoid, please)

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

Ted.Harding-2
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 <[hidden email]>
>>>>>>     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!

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <[hidden email]>
Fax-to-email: +44 (0)870 094 0861
Date: 18-May-10                                       Time: 17:05:57
------------------------------ XFMail ------------------------------

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

milton ruser
In reply to this post by Martin Maechler
Hi Martin,

thanks for your reply, and very thanks for your kind tips about "package"
and "library"
So, I was trying to understand *why* we load packages using library().
I suggest that developers killl the problem on its root, deleting library
function :-)
Good to know already installed packages will not be reinstalled.

cheers

milton

On Tue, May 18, 2010 at 12:49 PM, Martin Maechler <
[hidden email]> wrote:

> { I've modified the subject; I can't stand it hitting square into
>  my face ... }
>
> >>>>> "mr" == milton ruser <[hidden email]>
> >>>>>     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. As I am
> using
>    mr> a low-band internet, how can avoid reinstall 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()  ????
>         ^^^^^^^^
>
> ---
> To answer the question you did want to ask:
>
> Do not be afraid:  Depedencies are only installed when needed,
> i.e., no package will be downloaded and installed if it already
> is there.
>
> Martin Maechler, ETH Zurich
>
>    mr> cheers
>
>    mr> milton
>
>    mr> [[alternative HTML version deleted]]
>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> (another thing you should learn to avoid, please)
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

Peter Ehlers
In reply to this post by Ted.Harding-2
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<[hidden email]>
>>>>>>>      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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

Ted.Harding-2
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<[hidden email]>
>>>>>>>>      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) <[hidden email]>
Fax-to-email: +44 (0)870 094 0861
Date: 18-May-10                                       Time: 18:03:45
------------------------------ XFMail ------------------------------

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

Martin Maechler
In reply to this post by milton ruser
On Tue, May 18, 2010 at 18:06, milton ruser <[hidden email]> wrote:

> Hi Martin,
>
> thanks for your reply, and very thanks for your kind tips about "package"
> and "library"
> So, I was trying to understand *why* we load packages using library().
>

I've started to use and suggest using   require(.) instead
{as my efforts to introduce  use() or usePackage() *and* deprecating
 library()  where met with strong opposition}


> I suggest that developers killl the problem on its root, deleting library
> function :-)
> Good to know already installed packages will not be reinstalled.
>
> cheers
>
> milton
>
> On Tue, May 18, 2010 at 12:49 PM, Martin Maechler <
> [hidden email]> wrote:
>
>> { I've modified the subject; I can't stand it hitting square into
>>  my face ... }
>>
>> >>>>> "mr" == milton ruser <[hidden email]>
>> >>>>>     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. As I
>> am using
>>    mr> a low-band internet, how can avoid reinstall 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()  ????
>>         ^^^^^^^^
>>
>> ---
>> To answer the question you did want to ask:
>>
>> Do not be afraid:  Depedencies are only installed when needed,
>> i.e., no package will be downloaded and installed if it already
>> is there.
>>
>> Martin Maechler, ETH Zurich
>>
>>    mr> cheers
>>
>>    mr> milton
>>
>>    mr> [[alternative HTML version deleted]]
>>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> (another thing you should learn to avoid, please)
>>
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

William Dunlap
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Martin Maechler
> Sent: Tuesday, May 18, 2010 1:25 PM
> To: milton ruser
> Cc: [hidden email]
> Subject: Re: [R] avoiding reinstall already installed *package*
>
> On Tue, May 18, 2010 at 18:06, milton ruser
> <[hidden email]> wrote:
>
> > Hi Martin,
> >
> > thanks for your reply, and very thanks for your kind tips
> about "package"
> > and "library"
> > So, I was trying to understand *why* we load packages using
> library().
> >
>
> I've started to use and suggest using   require(.) instead
> {as my efforts to introduce  use() or usePackage() *and* deprecating
>  library()  where met with strong opposition}

I hate to get into arguments over function names, but
I would have thought that require("pkg") would throw
an error if the required pkg was not available.  It seems
like require() can be used when pkg is not really required
but library("pkg") is easiest when pkg is required to
continue:

  > { require("noSuchPackage"); functionFromNoSuchPackage() }
  Loading required package: noSuchPackage
  Error: could not find function "functionFromNoSuchPackage"
  In addition: Warning message:
  In library(package, lib.loc = lib.loc, character.only = TRUE,
logical.return = TRUE,  :
    there is no package called 'noSuchPackage'
  > { library("noSuchPackage"); functionFromNoSuchPackage() }
  Error in library("noSuchPackage") :
    there is no package called 'noSuchPackage'

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

>
>
> > I suggest that developers killl the problem on its root,
> deleting library
> > function :-)
> > Good to know already installed packages will not be reinstalled.
> >
> > cheers
> >
> > milton
> >
> > On Tue, May 18, 2010 at 12:49 PM, Martin Maechler <
> > [hidden email]> wrote:
> >
> >> { I've modified the subject; I can't stand it hitting square into
> >>  my face ... }
> >>
> >> >>>>> "mr" == milton ruser <[hidden email]>
> >> >>>>>     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. As I
> >> am using
> >>    mr> a low-band internet, how can avoid reinstall
> 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()  ????
> >>         ^^^^^^^^
> >>
> >> ---
> >> To answer the question you did want to ask:
> >>
> >> Do not be afraid:  Depedencies are only installed when needed,
> >> i.e., no package will be downloaded and installed if it already
> >> is there.
> >>
> >> Martin Maechler, ETH Zurich
> >>
> >>    mr> cheers
> >>
> >>    mr> milton
> >>
> >>    mr> [[alternative HTML version deleted]]
> >>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >> (another thing you should learn to avoid, please)
> >>
> >>
> >
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

milton ruser
*but* going back to my question, is not true
that already installed packages will not be
reinstaled. I ran:

install.packages(c("ggplot2"),dependencies=T)
install.packages(c("mgcv","bbmle","akima","drc","sensitivity","tgp"),dependencies=T)

and several packages installed during the first install.packages
were reinstalled on the second install.packages.

cheers

milton

On Tue, May 18, 2010 at 5:38 PM, William Dunlap <[hidden email]> wrote:

> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf Of Martin Maechler
> > Sent: Tuesday, May 18, 2010 1:25 PM
> > To: milton ruser
> > Cc: [hidden email]
> > Subject: Re: [R] avoiding reinstall already installed *package*
> >
> > On Tue, May 18, 2010 at 18:06, milton ruser
> > <[hidden email]> wrote:
> >
> > > Hi Martin,
> > >
> > > thanks for your reply, and very thanks for your kind tips
> > about "package"
> > > and "library"
> > > So, I was trying to understand *why* we load packages using
> > library().
> > >
> >
> > I've started to use and suggest using   require(.) instead
> > {as my efforts to introduce  use() or usePackage() *and* deprecating
> >  library()  where met with strong opposition}
>
> I hate to get into arguments over function names, but
> I would have thought that require("pkg") would throw
> an error if the required pkg was not available.  It seems
> like require() can be used when pkg is not really required
> but library("pkg") is easiest when pkg is required to
> continue:
>
>  > { require("noSuchPackage"); functionFromNoSuchPackage() }
>  Loading required package: noSuchPackage
>  Error: could not find function "functionFromNoSuchPackage"
>  In addition: Warning message:
>  In library(package, lib.loc = lib.loc, character.only = TRUE,
> logical.return = TRUE,  :
>    there is no package called 'noSuchPackage'
>  > { library("noSuchPackage"); functionFromNoSuchPackage() }
>  Error in library("noSuchPackage") :
>    there is no package called 'noSuchPackage'
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
> >
> >
> > > I suggest that developers killl the problem on its root,
> > deleting library
> > > function :-)
> > > Good to know already installed packages will not be reinstalled.
> > >
> > > cheers
> > >
> > > milton
> > >
> > > On Tue, May 18, 2010 at 12:49 PM, Martin Maechler <
> > > [hidden email]> wrote:
> > >
> > >> { I've modified the subject; I can't stand it hitting square into
> > >>  my face ... }
> > >>
> > >> >>>>> "mr" == milton ruser <[hidden email]>
> > >> >>>>>     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. As I
> > >> am using
> > >>    mr> a low-band internet, how can avoid reinstall
> > 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()  ????
> > >>         ^^^^^^^^
> > >>
> > >> ---
> > >> To answer the question you did want to ask:
> > >>
> > >> Do not be afraid:  Depedencies are only installed when needed,
> > >> i.e., no package will be downloaded and installed if it already
> > >> is there.
> > >>
> > >> Martin Maechler, ETH Zurich
> > >>
> > >>    mr> cheers
> > >>
> > >>    mr> milton
> > >>
> > >>    mr> [[alternative HTML version deleted]]
> > >>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >> (another thing you should learn to avoid, please)
> > >>
> > >>
> > >
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: avoiding reinstall already installed *package*

Henrik Bengtsson
On Wed, May 19, 2010 at 7:20 AM, milton ruser <[hidden email]> wrote:
> *but* going back to my question, is not true
> that already installed packages will not be
> reinstaled. I ran:
>
> install.packages(c("ggplot2"),dependencies=T)
> install.packages(c("mgcv","bbmle","akima","drc","sensitivity","tgp"),dependencies=T)
>
> and several packages installed during the first install.packages
> were reinstalled on the second install.packages.

I guess your question is, if I do

install.packages("fortunes");
install.packages("fortunes");

will the 'fortunes' package be installed twice?  Answer, yes.

It would probably not be too hard to add a 'force' argument so that:

# Install package first time
install.packages("fortunes");

# If package is already installed, skip it.
install.packages("fortunes", force=FALSE);

# If package is already installed, install it again.
install.packages("fortunes", force=TRUE);

If force=FALSE is the default, then

install.packages("fortunes");
install.packages("fortunes");

would install only once.  I can also imagine force="ask" an more.
Maybe there are better names for the argument, e.g. onExist=c("skip",
"install", "ask").

/Henrik

>
> cheers
>
> milton
>
> On Tue, May 18, 2010 at 5:38 PM, William Dunlap <[hidden email]> wrote:
>
>> > -----Original Message-----
>> > From: [hidden email]
>> > [mailto:[hidden email]] On Behalf Of Martin Maechler
>> > Sent: Tuesday, May 18, 2010 1:25 PM
>> > To: milton ruser
>> > Cc: [hidden email]
>> > Subject: Re: [R] avoiding reinstall already installed *package*
>> >
>> > On Tue, May 18, 2010 at 18:06, milton ruser
>> > <[hidden email]> wrote:
>> >
>> > > Hi Martin,
>> > >
>> > > thanks for your reply, and very thanks for your kind tips
>> > about "package"
>> > > and "library"
>> > > So, I was trying to understand *why* we load packages using
>> > library().
>> > >
>> >
>> > I've started to use and suggest using   require(.) instead
>> > {as my efforts to introduce  use() or usePackage() *and* deprecating
>> >  library()  where met with strong opposition}
>>
>> I hate to get into arguments over function names, but
>> I would have thought that require("pkg") would throw
>> an error if the required pkg was not available.  It seems
>> like require() can be used when pkg is not really required
>> but library("pkg") is easiest when pkg is required to
>> continue:
>>
>>  > { require("noSuchPackage"); functionFromNoSuchPackage() }
>>  Loading required package: noSuchPackage
>>  Error: could not find function "functionFromNoSuchPackage"
>>  In addition: Warning message:
>>  In library(package, lib.loc = lib.loc, character.only = TRUE,
>> logical.return = TRUE,  :
>>    there is no package called 'noSuchPackage'
>>  > { library("noSuchPackage"); functionFromNoSuchPackage() }
>>  Error in library("noSuchPackage") :
>>    there is no package called 'noSuchPackage'
>>
>> Bill Dunlap
>> Spotfire, TIBCO Software
>> wdunlap tibco.com
>>
>> >
>> >
>> > > I suggest that developers killl the problem on its root,
>> > deleting library
>> > > function :-)
>> > > Good to know already installed packages will not be reinstalled.
>> > >
>> > > cheers
>> > >
>> > > milton
>> > >
>> > > On Tue, May 18, 2010 at 12:49 PM, Martin Maechler <
>> > > [hidden email]> wrote:
>> > >
>> > >> { I've modified the subject; I can't stand it hitting square into
>> > >>  my face ... }
>> > >>
>> > >> >>>>> "mr" == milton ruser <[hidden email]>
>> > >> >>>>>     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. As I
>> > >> am using
>> > >>    mr> a low-band internet, how can avoid reinstall
>> > 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()  ????
>> > >>         ^^^^^^^^
>> > >>
>> > >> ---
>> > >> To answer the question you did want to ask:
>> > >>
>> > >> Do not be afraid:  Depedencies are only installed when needed,
>> > >> i.e., no package will be downloaded and installed if it already
>> > >> is there.
>> > >>
>> > >> Martin Maechler, ETH Zurich
>> > >>
>> > >>    mr> cheers
>> > >>
>> > >>    mr> milton
>> > >>
>> > >>    mr> [[alternative HTML version deleted]]
>> > >>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> > >> (another thing you should learn to avoid, please)
>> > >>
>> > >>
>> > >
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > [hidden email] mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> > http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>> >
>>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.