[R] How define global Variable?

Gabor Grothendieck ggrothendieck at gmail.com
Mon Nov 28 16:24:27 CET 2005


See:

http://tolstoy.newcastle.edu.au/~rking/R/help/05/11/15737.html

and the responses.

On 11/28/05, svenknueppel at reilich.net <svenknueppel at reilich.net> wrote:
> Hello,
>
> I try to define a global variable.
>
> My example:
>
> R> a <- "old"
> R> test <- function () { a <- "new" }
> R> test()
> R> a # shoud be "new"
>
> This doesn't work. I would like to modify the variable "a" in a
> procedure. How can I do that.
>
> Thank you for helping.
>
> Sven Knüppel (Germany-Berlin)
>
>
>
> ______________________________________________
> R-help at 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
>
>




More information about the R-help mailing list