[Rd] NAMESPACE/DESCRIPTION and imports

James MacDonald jmacdon at med.umich.edu
Sun Dec 14 20:12:31 CET 2008


Hi,

Could someone point me to the relevant documentation that covers what should be in the DESCRIPTION file for packages that have functions imported via the NAMESPACE file? I have read the R Extensions manual, but I cannot find where it covers the DESCRIPTION file vis a vis importing from a namespace.

An example:

I have a package foo that uses two functions x and y from package bar. Both packages have namespaces, and I just want to import the functions from bar rather than attaching the package.

I put 

Imports: bar

in my DESCRIPTION file and

importFrom(bar, x, y)

in my NAMESPACE file.

I have a vignette that uses both x and y from bar, and when I run R CMD build foo, at the vignette building step it errors out because it cannot find function x. If I add

Depends: bar

to my DESCRIPTION file it all works, but bar is attached and it seems I have not accomplished what I wanted. I am obviously misunderstanding something but I don't know what.

Best,

Jim



James W. MacDonald, M.S.
Biostatistician
Hildebrandt Lab
8220D MSRB III
1150 W. Medical Center Drive
Ann Arbor MI 48109-0646
734-936-8662
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues



More information about the R-devel mailing list