[R] transition from depends to imports

Andreas Leha andreas.leha at med.uni-goettingen.de
Fri May 9 23:08:15 CEST 2014


Hi all,

I am having trouble to do a particular transition from depends to
imports in one of my packages.

This packages uses 'wilcoxsign_test' from the 'coin' package.  And this
is the only function from the coin package that it uses (directly).

(Everything works fine, as long as my package depends on the coin
package.)

My guess was, that I would need to only import that function from the
coin package. (I.e. to move the coin package from Depends
to Imports in the DESCRIPTION and in the NAMESPACE do
'importFrom(coin,wilcoxsign_test)'.)

But then, calling wilcoxsign_test leads to this error:
,----
| Error in formula2data(formula, data, subset, frame = parent.frame(), ...) : 
|   could not find function "ModelEnvFormula"
`----

Now, formula2data is an unexported function in the coin package and
ModelEnvFormula is a (exported) function in modeltools.

So, I tried to import ModelEnvFormula from modeltools -- no avail.
And I tried to import formula2data from coin -- not possible
And I tried to import the whole coin package -- no avail.

So, here is the question:  How do I import 'wilcoxsign_test' from the
coin package in a way, that it is usable?

Many thanks in advance.

Regards,
Andreas



More information about the R-help mailing list