From hpages at fhcrc.org  Thu Jan 12 21:12:48 2012
From: hpages at fhcrc.org (=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=)
Date: Thu, 12 Jan 2012 12:12:48 -0800
Subject: [Rd] Silently loading and Depends: versus NAMESPACE imports
In-Reply-To: <20237.58927.327444.422917@max.nulle.part>
References: <20237.58927.327444.422917@max.nulle.part>
Message-ID: <4F0F3EC0.5060500@fhcrc.org>

Hi Dirk,

On 01/11/2012 11:42 AM, Dirk Eddelbuettel wrote:
>
> R CMD check really hates it when my .onLoad() function contains
>      suppressMessages(library(foo))

Note that you can always fool 'R CMD check' by doing something like:

     sillyname <- library
     suppressMessages(sillyname("foo"))

Also isn't suppressPackageStartupMessages() more appropriate?

>
> However, _and for non-public packages not going to CRAN_ I prefer doing this
> over using explicit Depends or import statements in the NAMESPACE file as the
> latter do not give me an ability to make the loading less verbose.  With the
> R universe of packages being as vast as at is, a simple (non-public) package
> I have loads about five or six other packages explicitly, each of which loads
> even more.  The net result is totally intimidating _sixty lines full_ of
> verbose noise that is meaningful to me as an R programmer, but not for the
> colleagues expected to use the packages. It looks rather uninviting, frankly.
>
> How do I use imports via NAMESPACE, and yet keep the noise level down to zero?

If you only need to import foo (i.e. and actually don't need to attach
it to the search path) then putting foo in Imports and using import
statements in NAMESPACE will keep the noise level down to zero.

So I guess your question is: how do we suppress package startup messages
for packages listed in Depends?

Cheers,
H.

>
> Dirk
>


-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] Silently loading and Depends: versus NAMESPACE imports
=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=