From csprin@brandybuck.ca.sandia.gov  Tue May 28 23:30:13 2002
From: csprin@brandybuck.ca.sandia.gov (Clayton Springer)
Date: Tue, 28 May 2002 15:30:13 -0700
Subject: masking
Message-ID: <20020528153013.D7826@brandybuck>

Dear R developers,

I am newbie to R-development.

I have written mutated the rpart to obtain myown package that performs some additional calculations
on trees.  I have altered the names of rpart's functions so there is no namespace conflict, but there
is redunant functionality.  However there some remaining functions that I am not sure what to do with.

When I run R and load both libraries I get masking:


> library(dI)
> library(rpart)

Attaching package `rpart':


	The following object(s) are masked from package:dI :

	 is.Surv string.bounding.box tree.depth 


There is conflict because of the zzz.R file


% less  zzz.R
.First.lib <- function(lib, pkg) library.dynam("dI", pkg, lib)

is.Surv <- function(x) inherits(x, "Surv")

tree.depth <- function (nodes)
{
    depth <- floor(log(nodes, base = 2) + 1e-7)
    as.vector(depth - min(depth))
}

string.bounding.box <- function(s)
{
    s2 <- strsplit(s, "\n")
    rows <- sapply(s2, length)
    columns <- sapply(s2, function(x) max(nchar(x)))
    list(columns=columns, rows=rows)
}


My question:

1.  Why is the functionality of the 'zzz.R' file needed?

2.  How do I retain it without creating conflicts with rpart proper?


thanks in advance for your help,

Clayton
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


masking
Clayton Springer