[Rd] Problem: Importing two packages which export a function with the same name

Benjamin Hofner benjamin.hofner at imbe.med.uni-erlangen.de
Tue Apr 15 15:12:16 CEST 2014


Hi all,

I am currently updating our package gamboostLSS which depends on package 
mboost *and* on package gamlss.dist. From mboost we use a lot of the 
fitting infrastructure and from gamlss.dist we obtain the relevant loss 
functions (aka families) used for fitting and corresponding quantile 
functions. Furthermore, we use the Family() function from package mboost.

However, if I depend on both packages, mboost::Family is always masked 
by a function of the same name from package gamlss.dist.

I tried to change the order of mboost and gamlss.dist in both my 
NAMESPACE and my DESCRIPTION file but couldn't see any difference in the 
result: gamlss.dist is always loaded after mboost and thus it breaks my 
code.

Actually, I would love to use something similar to importFrom() with a 
pattern that excludes Family, i.e.,

importFrom(gamlss.dist, exclude_pattern = "Family")

or the same with an include pattern designed to exclude Family in my 
NAMESPACE. Is this possible anyhow?

As gamlss.dist keeps evolving over time with more families to be added, 
I cannot manually importFrom(...) all the relevant families. I would 
have to change the list of functions all the time.

Thanks and all the best,
Benjamin



More information about the R-devel mailing list