[R] Ploting rpart objects / namespace problems

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jun 2 18:28:44 CEST 2003


On Mon, 2 Jun 2003, Luis Torgo wrote:

> I've written a small adaptation of the text.rpart function of the rpart 
> package to better suite my tree presentation needs (I basically left the code 
> untouched, only changing some numbers relating to label positioning).
> 
> When I changed to version 1.7.0 this function stopped working printing the 
> error :
>     couldn't find function "rpartco"
> 
> As far as I understand this has to do with the new namespaces conventions and 
> the package rpart not exporting "rpartco". Is there an obvious way of 
> adapting my function so that I can call the function "rpartco" even if it is 
> not exported from the package? If not, is there any way of going arround this 
> without having to give up my self-tuned text.rpart ?

getFromNamespace("rpartco", "rpart")

> A second related question is the following: when I faced the problem mentioned 
> above the first thing I done was trying to print the fucntion "text.rpart" to 
> check whether something changed dramatically. I was unable to do that because 
> of the same exporting reasons I guess. The only way I manage to see the code 
> of "text.rpart" was through:
> > get("text.rpart",envir=environment(rpart))
> 
> Is there an easiest way of seeing the code of this type of "hidden" functions?

See ?getS3method

These functions (and others) are mentioned in the NEWS file.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list