[R] using functions from other packages in own package

Jannis bt_jannis at yahoo.de
Tue Aug 20 16:51:59 CEST 2013


Dear R community,

I am creating my own package which uses functions from other packages. 
After reading several books/help pages I now would do the following to 
safely use some functions from other packages:

1. list them in Imports: (DESCRIPTION file)
2. put importFrom(packagename, functionname1, functionname2) in NAMESPACE

Apparently this now also works without loading the external package with 
require() or library() inside the function that uses the imported functions.

Is this the recommended way to do this (even if there may be several 
ways...)? Is it save to remove all the library() and require() calls?


Thanks a lot
Jannis



More information about the R-help mailing list