[R] Is there a way force hiding of all messages when calling library()?

Saiwing Yeung saiwing at berkeley.edu
Thu Dec 22 00:44:39 CET 2011


suppressPackageStartupMessages(library(spam))

takes care of that, thanks!!


On Dec 21, 2011, at 3:39 PM, Hadley Wickham wrote:

> You should be able to suppress them with
> suppressPackageStartupMessages() but not all packages produce startup
> messages in the approved manner.
> 
> Hadley
> 
> On Wed, Dec 21, 2011 at 5:36 PM, Saiwing Yeung <saiwing at berkeley.edu> wrote:
>> For example, if I call "library(spam)", I would get messages like this
>> 
>> Package 'spam' is loaded. Spam version 0.27-0 (2011-08-17).
>> Type demo( spam) for some demos, help( Spam) for an overview
>> of this package.
>> Help for individual functions is optained by adding the
>> suffix '.spam' to the function name, e.g. 'help(chol.spam)'.
>> 
>> Attaching package: ‘spam’
>> 
>> The following object(s) are masked from ‘package:base’:
>> 
>>    backsolve, forwardsolve, norm
>> 
>> 
>> While I understand that it's helpful to see these message at times, most of the time I already knew these information, especially when I run things from a script. The bigger problem is that it clutters up the output and makes it harder to notice if there are real problems. I have tried "library(spam, warn.conflicts=T, quietly=F, verbose=F)" but it didn't help at all. Are there other ways to hide these messages? Thank you.
>> 
>> ______________________________________________
>> R-help at r-project.org 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.
> 
> 
> 
> -- 
> Assistant Professor / Dobelman Family Junior Chair
> Department of Statistics / Rice University
> http://had.co.nz/



More information about the R-help mailing list