[R] How to do a go to in a loop in R

2004-07-21 Thread Lisa Wang
Hi there, I'm writing a function which involves a loop. What to write in the ? place would allow it skips the for loop and goes to a[i]-0. a-b[s3,] if (nrow(a)==0) ? for (i in 1:nrow(a)){ a[i]-1 } a[i]-0 Lisa Wang Cancer

Re: [R] How to do a go to in a loop in R

2004-07-21 Thread Gabor Grothendieck
Lisa Wang lisawang at uhnres.utoronto.ca writes: : : Hi there, : : I'm writing a function which involves a loop. What to write in the ? : place would allow it skips the for loop and goes to a[i]-0. : : a-b[s3,] : : if (nrow(a)==0) ? : : for (i in 1:nrow(a)){ :

Re: [R] How to do a go to in a loop in R

2004-07-21 Thread Rolf Turner
Well, there ain't no such thing in R And your code doesn't really make sense anyway. You talk about ``a[i]'' where a is apparently a ***matrix*** (with the same number of columns as the matrix b, but with fewer --- possibly 0 --- rows). And in such as setting a[i] has a meaning, but