From cubranic at stat.ubc.ca  Tue Feb 26 00:25:22 2013
From: cubranic at stat.ubc.ca (Davor Cubranic)
Date: Mon, 25 Feb 2013 15:25:22 -0800
Subject: [Rd] Recommended way to call/import functions from a Suggested
	package
In-Reply-To: <CABdHhvEwU9mgnnL1=iHur-JMFwOOPkkv8P164g=uVuaf8xWajQ@mail.gmail.com>
References: <FD2C7845-F6AD-4AA1-91C1-8CB14F43AA7D@stat.ubc.ca>
	<CABdHhvHkJkyzKODdDKKt+fmCeUAXJC7L24vXLuLPWmRYsYZtkQ@mail.gmail.com>
	<FDF2030A-2A91-4A40-B09F-C4DD78682A62@r-project.org>
	<CABdHhvHx1H09Qbx6mGBZUkB-yyta5nNv-cg=JgbS+0Js-iN7Yw@mail.gmail.com>
	<4F6FBC64-4EAE-43E2-B041-B54663CDF950@stat.ubc.ca>
	<CABdHhvEwU9mgnnL1=iHur-JMFwOOPkkv8P164g=uVuaf8xWajQ@mail.gmail.com>
Message-ID: <2ED56844-0DBF-4E2B-96BE-46243438F218@stat.ubc.ca>

I don't see any warnings if MASS is listed in Suggests in the DESCRIPTION.

Davor

On 2013-02-25, at 1:28 PM, Hadley Wickham wrote:

>> To summarize, it appears that the only way to call functions from a
>> suggested package is by using either 'require' (which will dynamically
>> attach it) or the double colon method. Is this something that should be
>> mentioned in R-exts?
> 
> Except the double colon method doesn't work (i.e. does not pass R CMD
> check) unless you also import the package, which means it's no longer
> just a suggestion - it must always be installed.
> 
> A simple test case (attached DESCRIPTION and R/test.r) yields this
> warning on R CMD check:
> 
> * checking for unstated dependencies in R code ... WARNING
> '::' or ':::' import not declared from: 'MASS'
> See the information on DESCRIPTION files in the chapter 'Creating R
> packages' of the 'Writing R Extensions' manual.
> 
> Hadley
> 
> -- 
> Chief Scientist, RStudio
> http://had.co.nz/
> <test.r><DESCRIPTION>



[Rd] Recommended way to call/import functions from a Suggested package
Davor Cubranic