From murdoch.duncan at gmail.com  Fri Sep  6 12:53:24 2013
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Fri, 06 Sep 2013 06:53:24 -0400
Subject: [Rd] Importing function that is previously imported by other
 package
In-Reply-To: <5229A20A.3010601@beuth-hochschule.de>
References: <5229A20A.3010601@beuth-hochschule.de>
Message-ID: <5229B424.9010905@gmail.com>

On 13-09-06 5:36 AM, Ulrike Gr?mping wrote:
> Dear developeRs,
>
> I encounter the following problem: in the current version of my package
> FrF2, certain calls to a functioni do not work when package combinat is
> loaded, because function combn from combinat masks the function from
> utils that my package uses.
> I tried to solve this issue by importing function combn into the
> namespace of FrF2; I don't need to export it, I just want to use it
> internally in the package; I could of course find all occurrences and
> replace them with utils::combn, but I thought that the namespace
> solution would be more elegant, faster, and in the spirit of R
> programming. The fix was successful: the installed package works with
> combinat on the search path.
>
> However, when installing or loading the modified FrF2, I now get the
> warning "replacing previous import by utils::combn when loading 'FrF2'"
> (that's on R-devel, on production R the wording is slightly different,
> but there is also a warning). There is no warning from R CMD check,
> however. In case this is relevant: None of the packages in my "Depends"
> list mentions "utils" under depends, one of the packages FrF2 depends on
> also imports from utils, including utils::combn.
>
> Shouldn't it be possible to have several packages IMport a function of
> the same name without a warning?
>
> Best, Ulrike
>

I think we need to see the details.  I don't get those warnings with the 
version on CRAN.  Perhaps you are importing it twice, e.g.

import(combinat)
importFrom(utils, combn)

?

Duncan Murdoch



[Rd] Importing function that is previously imported by other package
Duncan Murdoch