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)? Thanks, Max
Use two colons, not three. On Mon, Aug 25, 2008 at 3:05 PM, Max Kuhn <mxkuhn at gmail.com> 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)? > > Thanks, > > Max > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
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
Try this also: LogitBoost <- get("LogitBoost", envir as.environment("package:caTools"), mode = "function") On Mon, Aug 25, 2008 at 4:05 PM, Max Kuhn <mxkuhn at gmail.com> 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)? > > Thanks, > > Max > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O