Re: [R] R is GNU S, not C.... [was "how to get or store ....."]

From: <vincent_at_7d4.com>
Date: Wed 07 Dec 2005 - 05:50:21 EST

ronggui a ¨¦crit :

> I think it is NOT just for historical reason.
> see the following example:
> 

>>rm(x)
>>mean(x=1:10)
> [1] 5.5

>>x

> Error: object "x" not found

x is an argument local to mean(),
did you expect another answer ?

>>mean(x<-1:10)

> [1] 5.5

>>x

> [1] 1 2 3 4 5 6 7 8 9 10

What is the goal of this "example" ?

Here with "<-",
(voluntary, or not, side effect)
the global variable x is, also, created. Did the writer really want that ???

I though there were other specific statements especially intended for global assignment, eg "<<-".

If this example was intended to prove "<-" is better than "="
... I'm not really convinced !



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Dec 07 06:55:59 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:30 EST