Re: [Rd] delay of warning for things in .Rprofile

From: Prof Brian Ripley <>
Date: Wed 09 Mar 2005 - 06:33:14 GMT

On Tue, 8 Mar 2005, Liaw, Andy wrote:

> Hi all,
> I was playing with R-devel 2005-03-08 on winXP Pro (installed from Duncan's
> installer). My .Rprofile contains:
> options(defaultPackages=c(getOption("defaultPackages"), "mypkg"),
> chmhelp=TRUE)
> but "mypkg" has not yet been installed in the library/ directory of this
> installation. When Rgui starts, I do not get any error or warning, but upon
> running one command, I get:
> Warning messages:
> 1: there is no package called 'mypkg' in: library(package, character.only =
> TRUE, logical = TRUE, warn.conflicts = warn.conflicts,
> 2: package mypkg in options("defaultPackages") was not found
> This seems a bit strange... I would expect the warning to show up before
> the first prompt. Is this intentional?

It is normal. By default (options(warn=0)), warnings are collected and (to quote the help page) `printed after the top-level function has completed'. Warnings during startup wait until a top-level command has been completed. It is done in the main REPL loop at main.c:362 (and also under some error conditions).

As to whether this is intentional: I don't know but it would be helpful to change it, so I will.


Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Wed Mar 09 17:38:16 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:26:26 GMT