From mtmorgan at fhcrc.org  Thu Oct 21 01:29:09 2010
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Wed, 20 Oct 2010 16:29:09 -0700
Subject: [Rd] library verbose option doesn't stop "Loading required
 package XYZ"
In-Reply-To: <AANLkTikpctkCnj50x2XbaZCNxqhCjUqPLqgXaFEhVgct@mail.gmail.com>
References: <AANLkTimCoFJibeienRkQ5aXUoc-2DGqH2Biov3Cu6_Lt@mail.gmail.com>	<94DF5568-CBE9-4049-BC82-1396AF88D8F3@comcast.net>
	<AANLkTikpctkCnj50x2XbaZCNxqhCjUqPLqgXaFEhVgct@mail.gmail.com>
Message-ID: <4CBF7B45.5080509@fhcrc.org>

On 10/20/2010 04:25 PM, Dominick Samperi wrote:
> Thanks David, but this doesn't work. Under R 2.12.0 the "Loading required
> packages"
> messages appear under R 2.12.0 when I use, for example:
> 
> Rscript --vanilla -e "{ invisible(library(cxxPack)); cat(sqrt(2)) }"

?suppressPackageStartupMessages

though you'll still get warnings / errors.

Martin

> 
> On Wed, Oct 20, 2010 at 7:00 PM, David Winsemius <dwinsemius at comcast.net>wrote:
> 
>>
>> On Oct 20, 2010, at 6:49 PM, Dominick Samperi wrote:
>>
>>  Hello,
>>>
>>> The library verbose option does not stop numerous messages
>>> of the form "Loading required package: XYZ". This is inconvenient
>>> when a package is loaded repeatedly using Rscript.
>>>
>>> Is there a way to turn off the "Loading required package"
>>> messages?
>>>
>>
>> ?invisible
>>> invisible(require(Hmisc))
>>> invisible(library(rms)  )  # no console messages
>>
>> I do not think this suppress the messages when you attempt to load a
>> non-existent package. For that you may need to look at the options() setting
>> for warn and warning.expression
>>
>>>
>>> One possible work-around is to make packages Suggested
>>> instead of Required, but this introduces other issues.
>>>
>>> Thanks,
>>> Dominick
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>> David Winsemius, MD
>> West Hartford, CT
>>
>>
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



[Rd] library verbose option doesn't stop "Loading required package XYZ"
Martin Morgan