__
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
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
[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.
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
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
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
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
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
: [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
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
10 matches
Mail list logo