Re: [Rd] source, sys.source and error line numbers

2013-03-26 Thread Renaud Gaujoux
Sounds good for me. Thanks. 2013/3/27 Duncan Murdoch > On 13-03-26 6:45 PM, Hadley Wickham wrote: > >> It turns out the reason for this is pretty simple: >> >> sys.source does: >> for (i in exprs) eval(i, envir) >> >> where source basically does >> n <- length(exprs) >> for (i in seq_len(n)) ev

Re: [Rd] source, sys.source and error line numbers

2013-03-26 Thread Duncan Murdoch
On 13-03-26 6:45 PM, Hadley Wickham wrote: It turns out the reason for this is pretty simple: sys.source does: for (i in exprs) eval(i, envir) where source basically does n <- length(exprs) for (i in seq_len(n)) eval(expr[i], envir) so the problem is presumably related to the way that for stri

Re: [Rd] source, sys.source and error line numbers

2013-03-26 Thread Hadley Wickham
It turns out the reason for this is pretty simple: sys.source does: for (i in exprs) eval(i, envir) where source basically does n <- length(exprs) for (i in seq_len(n)) eval(expr[i], envir) so the problem is presumably related to the way that for strips attributes. Hadley On Tue, Mar 19, 2013

[Rd] source, sys.source and error line numbers

2013-03-19 Thread Renaud Gaujoux
Hi, is there a way to retrieve the line number of where en error occurred when sourcing a file in a tryCatch statement? Is it stored somewhere accessible? It is not found in the error object. Consider the following code/output and note the difference in the traceback between source (has line numb