From bolker at ufl.edu  Thu Jun  3 15:27:30 2010
From: bolker at ufl.edu (Ben Bolker)
Date: Thu, 03 Jun 2010 09:27:30 -0400
Subject: [Rd] warning from install.packages()
In-Reply-To: <19463.25159.870742.187684@lynne.math.ethz.ch>
References: <4BFC3228.9010400@ufl.edu>	<C822177B.EBC1%jari.oksanen@oulu.fi>	<loom.20100601T142323-304@post.gmane.org>	<Zen-1OJrWm-0006gD-SM@smarthost02.mail.zen.net.uk>	<4C0698AE.7010304@ufl.edu>
	<19463.25159.870742.187684@lynne.math.ethz.ch>
Message-ID: <4C07ADC2.1010101@ufl.edu>

Martin Maechler wrote:
>>>>>> "BB" == Ben Bolker <bolker at ufl.edu>
>>>>>>     on Wed, 02 Jun 2010 13:45:18 -0400 writes:
> 
>     BB> Michael Dewey wrote:
>     >> At 13:40 01/06/2010, Ben Bolker wrote:
>     >> 
>     >>>> On 25/05/10 23:25 PM, "Ben Bolker" <bolker <at> ufl.edu> wrote:
>     >>>> Just curious: is there a particular reason why install.packages()
>     >>>> gives a warning in normal use when 'lib' is not specified (e.g. argument
>     >>>> 'lib' is missing: using '/usr/local/lib/R/site-library' )?
>     >> 
>     >> As I see it R is saying 'I am doing what you told 
>     >> me, but just in case I am checking whether that 
>     >> was what you really wanted'. Note that you do not 
>     >> get a warning if there was only one place R could 
>     >> put it. I would certainly vote for a message if 
>     >> people are getting unnecessarily alarmed by the warning.
> 
>     BB> But this seems so different from R's general philosophy/behavior
>     BB> (inherited from Unix?) that a function that gets correct input and
>     BB> executes without error returns silently ...
> 
> That's correct.
> Note however that installing a package is not just a thing
> happening in your R session.
> It will affect all your future R sessions, and possibly even
> other users' who have the same  .libPaths()[1]
> {e.g. the group here does share it}.
> 
> I'd agree to not put a warning but I'd definitely want a message
> aka "note" to the user.
> The *wording* of that note should not be alarming at all, I
> agree, just a note to the user.
> 
> Martin Maechler, ETH Zurich

  OK, then, how about this as a minimal change?

===================================================================
--- packages.R	(revision 52192)
+++ packages.R	(working copy)
@@ -534,8 +534,8 @@

     if(missing(lib) || is.null(lib)) {
         lib <- .libPaths()[1L]
-        warning(gettextf("argument 'lib' is missing: using %s", lib),
-                immediate. = TRUE, domain = NA)
+        message(gettextf("argument 'lib' is missing: using %s", lib),
+                domain = NA)
     }

     paths <- .find.package(pkgs, lib)
Index: packages2.R
===================================================================
--- packages2.R	(revision 52192)
+++ packages2.R	(working copy)
@@ -193,8 +193,8 @@
     if(missing(lib) || is.null(lib)) {
         lib <- .libPaths()[1L]
         if(length(.libPaths()) > 1L)
-            warning(gettextf("argument 'lib' is missing: using '%s'", lib),
-                    immediate. = TRUE, domain = NA)
+            message(gettextf("argument 'lib' is missing: using '%s'", lib),
+                    domain = NA)
     }

     ## check for writability by user


-- 
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
*** NEW E-MAIL ADDRESSES:
***   bbolker at gmail.com , bolker at math.mcmaster.ca
bolker at ufl.edu / people.biology.ufl.edu/bolker
GPG key: people.biology.ufl.edu/bolker/benbolker-publickey.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100603/6be2bbfb/attachment.bin>


[Rd] warning from install.packages()
Ben Bolker