[R] How define global Variable?

svenknueppel@reilich.net svenknueppel at reilich.net
Mon Nov 28 15:26:49 CET 2005


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)

More information about the R-help mailing list