[R] Line numbers with errors and warnings?

Duncan Murdoch murdoch.duncan at gmail.com
Thu Dec 6 13:21:21 CET 2012


On 12-12-06 12:01 AM, Worik R wrote:
>
>
>     If you `source("test.R", keep.source=FALSE)`, you will see that the
>     line number is not reported.
>
>
> Not always.
>
> I have code that uses sapply to call another function and all I get back
> is the line of the sapply.
>
> Useful but in the 21st century I do think I could get more aid from the
> runtime and compiler to help me.

I would say that the problem isn't currently the runtime or compiler, 
the problem is the front end UI.  I think you're using ESS, and it is a 
separate project from R, so you could contribute changes to it that give 
it more of the debugging interface you want.  If there's really 
something missing in the low level support within R, I'd be quite 
interested in adding it, but honestly, I think the support within R is 
now roughly at the level of gdb, just the interface to it is weak.  Not 
that plain gdb has a great interface.

Duncan Murdoch

>
> I am giving up.
>
> In the short term I am giving yup on expecting line numbers (running
> with anything other than  options(error=NULL) is a pain for all sorts of
> reasons) and in the medium term I am giving up on R.
>
> It is sad.  R is very powerful and I can say a lot with very little.
> But I have been using it intensely for 3 years, written (and debugged)
> thousands of lines of code.  It is exactly what I need *but* the
> debugging facilities are too primitive and the time gained in design and
> implementation is lost, with interest, in debugging.
>
> IMO R is very suitable for simple tasks that would be complex in other
> languages.  But once it gets complex in R, it is too hard.
>
> I am not saying R is very bad -  far from it.  But for ambitious
> projects it cannot compete without proper debugging facilities.
>
> It may be that I am not good enough at programming - fair enough. But I
> am what I am, and I have been beating my head against this for far too long.
>
> Having large amounts of code in R that I use every day I am not running
> away at high speed.  But I am moving away.
>
> If R gets modern debugging (lets say up to where gdb was in the early
> 1990s) I'll be back with a big smile on my face.
>
> But I cannot dictate the priorities of the R maintainers, and I will not
> try.
>
> peace
> Worik Stanton
> Dunedin
> New Zealand
>




More information about the R-help mailing list