[R] Setting global variables inside R reference class ?

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Sat Jan 26 16:50:17 CET 2013

How can we possibly know where you went wrong if you don't tell us where you went?


Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

Praveen K <pravinkenator at gmail.com> wrote:

>I'm a newbie to R, I have a quesiton.
>I'm a bit confused on global variable assignments.
>I have the following situation. I have 2 global variables current_idx
>previous_idx. *These 2 global variables have to be set by a method in a
>reference class*.
>Essentially, using <<- assignment operator should work right ? But, I
>this warning
>Non-local assignment to non-field names (possibly misspelled?)
>Where am I going wrong ?
>Will assign(current_idx, index, envir = .GlobalEnv) work ?
>Thanks !
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list