[R] Two names of a function

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed May 14 10:04:40 CEST 2003


On Wed, 14 May 2003, Göran Broström wrote:

> Is it possible to let a function be known under two names without having
> two identical copies of the function body? 

Well, that's what .Alias did (have one copy), and it has been removed.  
There's nothing to stop you writing a version of .Alias via .Call, except
there were good reasons to remove it.  Given that, perhaps you should ask
what how to do what you really want to do (the top-level task that
prompted this question).

I don't think you can even know if there are two copies of the function 
body: there can be potential copies of R objects which are shared until 
one is altered.  I would have to read the internal code very carefully to 
find out if e.g. body<- made an actual copy.

-- 
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