Skip to content
Prev 302121 / 398502 Next

How to link two R packages together

I will reply inline here, but I believe any further questions about
package development should be posted to the R-devel list rather than
here (please someone correct me if this is wrong).

-- Bert
On Thu, Aug 2, 2012 at 7:02 AM, Xuan Zhao <xuan.zhao at sentrana.com> wrote:
"The ?Imports? field lists packages whose namespaces are imported from
(as specified in the
?NAMESPACE? file) but which do not need to be attached."

"Packages declared in the ?Depends? field should not
also be in the ?Imports? field."  [in the DESCRIPTION file]"

So the answer is no -- you should not do this, although as you
apparently did not specify the imports in the DESCRIPTION file, it
should have no effect.

 I added "import(PKG2)" to the NAMESPACE file.
So remove this.

 In addition to that, I install PKG2 under a path R can recognize,
namely, belong to ".libPaths()".

Of course. See ?library ?INSTALL  ?install.packages (in R).  This is
the 2nd paragraph of the installation manual, in which ALL your
questions are answered.

-- Bert