Re: [R] scoping rules for 'for' [was - Re: for/if loop ]

2009-01-29 Thread SnowManPaddington
for the clarifications. -- David -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: Thursday, January 29, 2009 9:54 AM To: David Reiner dav...@rhotrading.com Cc: Henrik Bengtsson; r-help@r-project.org; SnowManPaddington Subject: [SPAM] - Re: [R] scoping rules

[R] Optim error: initial value in 'vmmin' is not finite

2009-01-29 Thread SnowManPaddington
Error in optim(method = BFGS, c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : initial value in 'vmmin' is not finite I am running a logit model with latent class segments. I successfully got estimates for 2 segments. However when I tried to increase the no. of segments, I got this error message at

[R] for/if loop

2009-01-28 Thread SnowManPaddington
Hi, it's my first time to write a loop with R for my homework. This loop is part of the function. I wanna assign values for hll according to panel [ii,1]=pp. I didn't get any error message in this part. but then when I further calculate another stuff with hll, the function can't return. I think

Re: [R] for/if loop

2009-01-28 Thread SnowManPaddington
pp==pp+1 } if (ii==n){ hll[pp,1] == sum(lselb1[rr:ii]) hll[pp,2] == sum(lselb2[rr:ii]) rr==ii pp==pp+1 } ii=ii+1 } SnowManPaddington wrote: Hi, it's my