[R] Two names of a function

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Wed May 14 09:57:25 CEST 2003


Do you mean something like:
> sq <- function(x) x^2
> sq(2)
[1] 4
> sq(9)
[1] 81
> sq1 <- sq
> sq1(9)
[1] 81


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

> Date: Wed, 14 May 2003 09:59:13 +0200 (CEST)
> From: Göran Broström <gb at stat.umu.se>
> To: R-help <r-help at stat.math.ethz.ch>
> Subject: [R] Two names of a function
> 
> 
> Is it possible to let a function be known under two names without having
> two identical copies of the function body? 
> 
> ---
>  Göran Broström                    tel: +46 90 786 5223
>  Department of Statistics          fax: +46 90 786 6614
>  Umeå University                   http://www.stat.umu.se/egna/gb/
>  SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
Cheers,

Kevin

------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)




More information about the R-help mailing list