Hi again list.

Thanks for these replies.  I guess the issue is one of parsing units
being different from my expectations.  I saw a related issue in a
slightly different context a couple of days ago:


R> f1 <- function(a,b)
{a
-b}
R> f2 <- function(a,b)
{a-
 b}


...which (rightly) give very different results [the original bug took
me *hours* to find].

cheers

rksh




> It does work.  It just doesn't do what you expect.
> 
> Suppose you typed
>  {x^2} -> f3
> This would assign x^2 to f3.
> 
> So
>   function(x)
>     {x^2} -> f3
> 
> is an anonymous function of one argument, which assigns the square of that
> argument to the local variable f3.
> 
> To get what you wanted you would need
> 
> {function(x) x^2}-> f3
> 
>       -thomas
> 
> 


-- 

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

[EMAIL PROTECTED]
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to