Skip to content
Prev 173371 / 398506 Next

Using a NAMESPACE or the Imports field in DESCRIPTION?

Hello list,

I am writing a package which builds on a function ("foo") of another 
package. I only need that particular function. What is the state of 
the art to do this? Do I need a NAMESPACE file in my package? 
Currently I still don't have one. Or can I do this with the Imports 
field in my DESCRIPTION file? Reading chapter 1 of the "Writing R 
Extensions" manual I do not completely understand for what situations 
these two alternatives are intended for. The manual says that with 
the Imports field of DESCRIPTION I can "import the name space" of 
another package. What does that mean? What are the differences 
between the two alternatives? Are there consequences for how I can 
access function "foo" within the code of my package?

Thanks for some clarifications and recommendations!

Wolfgang Koller