From murdoch at stats.uwo.ca  Mon Aug 25 21:28:00 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Mon, 25 Aug 2008 15:28:00 -0400
Subject: [Rd] name conflicts
In-Reply-To: <6731304c0808251205y59e27447k99b6a8f93aef4132@mail.gmail.com>
References: <6731304c0808251205y59e27447k99b6a8f93aef4132@mail.gmail.com>
Message-ID: <48B307C0.8010000@stats.uwo.ca>

On 8/25/2008 3:05 PM, Max Kuhn wrote:
> Everyone,
> 
> I've got code in my package that uses LogitBoost from the caTools
> package. caTools does not have a namespace.
> 
> My package also uses loads RWeka, which has a namespace, and also has
> a function called LogitBoost.
> 
> After loading both packages, how can I be specific about running the
> version from caTools (since caTools:::LogitBoost won't work)?

It's not easy.  Best would be to convince caTools to add a NAMESPACE.

But as a workaround:

library(caTools)
caToolsEnv <- as.environment("package:caTools")
LogitBoost <- caToolsEnv$LogitBoost

Note that there is no guarantee that LogitBoost will actually work. 
Because caTools doesn't have a NAMESPACE, there is a risk of other name 
clashes causing LogitBoost to behave unpredictably.

Duncan Murdoch



[Rd] name conflicts
Duncan Murdoch