Re: [R] array loop

2007-08-01 Thread Petr PIKAL
Hi Dong GUO 郭东 [EMAIL PROTECTED] napsal dne 31.07.2007 15:27:35: Thanks, Petr. I changed the equation mark from = to -, then, it works fine. Dont know what difference it has made between the = and -.. from help page The operators - and = assign into the environment in which they are

Re: [R] array loop

2007-08-01 Thread Dong GUO 郭东
Thanks again, Petr. Following the reference, that would be true that = only assign values to the top level...So apparently using '-' is the safe all the time to assign values. Dong On 8/1/07, Petr PIKAL [EMAIL PROTECTED] wrote: Hi Dong GUO ¹ù¶« [EMAIL PROTECTED] napsal dne 31.07.2007

Re: [R] array loop

2007-07-31 Thread Dong GUO 郭东
Thanks, Petr. I changed the equation mark from = to -, then, it works fine. Dont know what difference it has made between the = and -.. Regards, Dong On 7/31/07, Petr PIKAL [EMAIL PROTECTED] wrote: Hi as you say that the computing is part of a function than the best way to see what is

[R] array loop

2007-07-30 Thread Dong GUO 郭东
Dear all, here are two arrays: region(26,31,8), nation(8) I tried to get a new array, say, giGi(26,31,8) giGi - array(0,dim = c(region_dim)) for (i in (1:region_dim[3])) { giGi[,,i] = region[,,i]-nation[,i] } As the above is part of function, but results shows only giGi[,,1] has the right