Thank you,
I will give this a good think
Mark Wardle wrote:
>
> projection83 wrote:
>> My R code has got too complex to have a non-modular approach. Ive done
>> some
>> coding in other languages before, but I somehow cant figure out R's
>> general
>> rules for global and local variables. I hav
projection83 wrote:
> My R code has got too complex to have a non-modular approach. Ive done some
> coding in other languages before, but I somehow cant figure out R's general
> rules for global and local variables. I have put a simple code below, if
> anyone can show me what i need to add to make
As long as you know what you are doing, and watch out carefully, then you
can do it. BTW, I do exactly what you are saying about manipulating large
data objects. I will use the 'indices' in functions like 'lapply' and in
the body of the function reference that data that is held in the global
obje
Jim Holtman wrote:
>
> The following will work, but I would suggest that you redesign your
> functions so that they do not use 'globals'; It is not nice for functions
> to have side-effects.
>
Globals are Evil, but, like goto, sometimes they can make a big
program become simpler. I don't see a n
The following will work, but I would suggest that you redesign your
functions so that they do not use 'globals'; It is not nice for functions
to have side-effects.
g_Means<-numeric()
defineSamples<- function()
{
g_Means <<-5 # check out ?"<<-"
}
runit<-functio
My R code has got too complex to have a non-modular approach. Ive done some
coding in other languages before, but I somehow cant figure out R's general
rules for global and local variables. I have put a simple code below, if
anyone can show me what i need to add to make this work, i would greatly