[R] right assignment ("->") and functions

Robin Hankin r.hankin at auckland.ac.nz
Mon Jun 23 05:32:04 CEST 2003


Hi everyone

check this out [R-1.7.0]:

R> f1 <- function(x){x^2}
R> f1 -> f2
R> f2(4)
[1] 16
R> 
R> function(x){x^2} -> f3
function(x){x^2} -> f3
R> f3(4)
Error: couldn't find function "f3"

Why does right assignment "->" work in the first but not the second
case?  Can anyone else reproduce this?


-- 

Robin Hankin, Lecturer,
School of Geography and Environmental Science
Tamaki Campus
Private Bag 92019 Auckland
New Zealand

r.hankin at auckland.ac.nz(nospam)
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042




More information about the R-help mailing list