Re: [R] priority of operators in the FOR ( ) statement

2005-08-24 Thread Petr Pikal
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Ravi . Vishnu
Dear All, I spent an entire evening in debugging a small, fairly simple program in R - without success. It was my Guru in Bayesian Analysis, Thomas Fridtjof, who was able to diagonose the problem. He said that it took a long time for him also to locate the problem. This program illustrates in

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Duncan Murdoch
[EMAIL PROTECTED] wrote: Dear All, I spent an entire evening in debugging a small, fairly simple program in R - without success. It was my Guru in Bayesian Analysis, Thomas Fridtjof, who was able to diagonose the problem. He said that it took a long time for him also to locate the problem.

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread P Ehlers
Since there is nothing wrong with for(i in 1:nr - 1) R can't really do much more than point to where your code fails due your incorrect assumption about operator precedence. You're certainly not the first to fall into this trap. But it's not that hard to diagnose. Anytime I have problems with a

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Patrick Burns
The command that I think is most useful in this situation is 'browser()'. Even a couple decades of programming in the S language hasn't yet solved the problem of my fingers typing code that doesn't match what I want to happen. I quite consistently have a browser() call in functions that I

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Ted Harding
On 23-Aug-05 Duncan Murdoch wrote: [...] ... in extreme cases, read the documentation. One for fortunes? Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 23-Aug-05

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Gabor Grothendieck
On 8/23/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear All, I spent an entire evening in debugging a small, fairly simple program in R - without success. It was my Guru in Bayesian Analysis, Thomas Fridtjof, who was able to diagonose the problem. He said that it took a long time for him

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Berton Gunter
Right on! (oops -- maybe that's another 60's phrase :( ) -- Bert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ted Harding Sent: Tuesday, August 23, 2005 4:08 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] priority of operators

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Berton Gunter
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns Sent: Tuesday, August 23, 2005 4:12 AM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] priority of operators in the FOR ( ) statement The command that I think is most useful in this situation

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread Jean Eid
Although it is not as fancy as all other responses, I usually just print the value of i first and see where it stopped. Of course this assumes you it is stored in the main env. If it is inside a function and it is failing I usually use the - operator to get it to the main env. and print it. Here