Re: [R] problem in my code

2006-07-10 Thread Thomas Lumley
On Mon, 10 Jul 2006, Gabor Grothendieck wrote: The problem can be reduced to this: x - 1 x[1] - 2 # error The following are ok: x - 1 x[1] - 3 x - 1 x - 4 x - 1 x - 5 Does anyone know why? Is this a bug in - ? No, it's a feature. The fact that x-5 works is arguably a bug

[R] problem in my code

2006-07-09 Thread Taka Matzmoto
Dear R-users I wrote a small program for assigning a membership Here is my script sample.size - 60 x - rnorm(sample.size, 0, 1) y - rnorm(sample.size, 0, 1) x.mean - mean(x) y.mean - mean(y) membership - numeric(sample.size) for (i in 1:sample.size) { if ((x[i] x.mean) (y[i]

Re: [R] problem in my code

2006-07-09 Thread W. Yamamoto
Hi, How about replacing all - with -? That error occured in membership[i] - 1 this line and this code stopped before cbind(x,y,membership) this line. Hope this may help you. --- W. Yamamoto Dear R-users I wrote a small program for assigning a membership Here is my

Re: [R] problem in my code

2006-07-09 Thread Gabor Grothendieck
The problem can be reduced to this: x - 1 x[1] - 2 # error The following are ok: x - 1 x[1] - 3 x - 1 x - 4 x - 1 x - 5 Does anyone know why? Is this a bug in - ? On 7/9/06, Taka Matzmoto [EMAIL PROTECTED] wrote: Dear R-users I wrote a small program for assigning a membership Here is