Skip to content
Prev 173374 / 398506 Next

Using a NAMESPACE or the Imports field in DESCRIPTION?

Hi Wolfgang --
Wolfgang Koller wrote:
It sounds like you want to add Imports: OtherPackage to DESCRIPTION, and

importFrom(OtherPackage, foo)

in you NAMESPACE file, in addition perhaps to

export(foo)

if you'd like users of your package to access foo. Using a NAMESPACE can 
be very beneficial, especially as your software grows in complexity -- 
it ensures ready access to the symbols you want (foo, in this case) 
without relying on the structure of the user search path. I don't think 
adding Imports to DESCRIPTION and adding a NAMESPACE should really be 
viewed as 'alternatives' -- add a NAMESPACE, and many of the packages 
that you had previously listed in Depends: likely belong more 
appropriately in Imports.

Martin