[R] Errors and line numbers in scripts?

Duncan Murdoch murdoch at stats.uwo.ca
Fri Sep 18 12:25:33 CEST 2009


ws wrote:
> Is there a way to have R return the line number in a script when it errors out?  
>
> I call my script like:
>
> $ R --vanilla < script.R > output.txt
>
> I seem to remember a long discussion about this at some point, but I can't 
> remember the outcome.
>
>   

The current development version returns much more information about 
error locations.  I don't know if it will handle this case (R doesn't 
get told the filename in case of input redirection, for example).  
Generally the goal is to report error lines during interactive use, 
batch use is assumed to already be debugged.

Duncan Murdoch




More information about the R-help mailing list