[Rd] a debugging difficulty

Patrick Burns pburns at pburns.seanet.com
Thu Dec 18 13:19:21 MET 2003


I had an error to debug that turned out to be essentially:

 > NULL * matrix(1:4, 2)
Error: dim<- length of dims do not match the length of object


The equivalent of the NULL was a variable that was meant
to be a scalar.  It took me a while to track down the problem
because I was focusing on looking for arrays that were different
than my expectation.

I think it could save substantial debugging time if the error message
stated the dims and the length of the object.

Also with

options(error=dump.frames)

set before the command above, we get:

 > debugger()
Message:  Error: dim<- length of dims do not match the length of object
Available environments had calls:
1:
0:

Enter an environment number, or 0 to exit  Selection: 1
Selection: 0
 >

That is, there is apparently an environment to select, but
trying to select it doesn't do anything.

This is with R version 1.8.1 on Windows and SuSe 8.2 (both precompiled).


Patrick Burns

Burns Statistics
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")



More information about the R-devel mailing list