[R] Depends and Imports in DESCRIPTION file

Duncan Murdoch murdoch.duncan at gmail.com
Wed Oct 23 11:48:00 CEST 2013


On 13-10-23 12:34 AM, Marc Girondot wrote:
> Le 23/10/13 05:03, Marc Girondot a écrit :
>> Dear list members:
>>
>> I try to check my updated package to include a new version in CRAN
>> (phenology) but a new error is indicated and I don't find the logic.
>> First my system:
>> * using R version 3.0.2 Patched (2013-09-27 r64011)
>> * using platform: x86_64-apple-darwin10.8.0 (64-bit)
>>
>> Here is the message:
>>
>> * checking dependencies in R code ... NOTE
>> Packages in Depends field not imported from:
>> ‘fields’ ‘zoo’
>> These packages needs to imported from for the case when
>> this namespace is loaded but not attached.
>> See the information on DESCRIPTION files in the chapter ‘Creating R
>> packages’ of the ‘Writing R Extensions’ manual.
>>
> I begin to find the origin of the problem... but not still the solution.
> When the NAMESPACE file is created by package.skeleton(), it includes:
> import(coda)
> but not
> import(fields)
> import(zoo)
>
> If I add these manually, the check is ok.
>
> Now the question becomes: why package.skeleton() does not add them and
> how to force package.skeleton() to add them ?

You should only use package.skeleton once, when you first decide to turn 
your code into a package.  After that, the assumption is that you will 
manually edit the files.

If you call it later, it will not make use of all the work you did on 
the previous attempt.

However, looking at the source, I don't see it ever writing import() 
lines to the namespace.  I think you must be mistaken about what it is 
doing.

Duncan Murdoch



More information about the R-help mailing list