Re: [R] Line numbers with errors and warnings?

2012-12-06 Thread Steve Lianoglou
On Thursday, December 6, 2012, Richard M. Heiberger wrote: > Worik, > > Please look at the developer and debug packages that have been in ESS since > summer 2012. They are designed to help you maneuver through complicated > code. > Among other things, it allows you to insert breakpoints at the so

Re: [R] Line numbers with errors and warnings?

2012-12-06 Thread Richard M. Heiberger
Worik, Please look at the developer and debug packages that have been in ESS since summer 2012. They are designed to help you maneuver through complicated code. Among other things, it allows you to insert breakpoints at the source code level. I suggest you start with the detailed discussion with

Re: [R] Line numbers with errors and warnings?

2012-12-06 Thread Duncan Murdoch
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 t

Re: [R] Line numbers with errors and warnings?

2012-12-05 Thread Worik R
Bert R is compiled. Compile and go cycle is quick, but it is compiled. Not to a machine executable but to an object the R runtinme can interperet. Steve It is all a bit hard. I can make progress the old fashioned way with debug messages and conditional execution and dozens of other techniques

Re: [R] Line numbers with errors and warnings?

2012-12-05 Thread Steve Lianoglou
Hi, On Thu, Dec 6, 2012 at 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. The function

Re: [R] Line numbers with errors and warnings?

2012-12-05 Thread Worik R
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 an

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Steve Lianoglou
Similar to Duncan's example, if you have a script "test.R" which looks like so: start script = a1 <- 1:10 a2 <- 101:122 plot(a1, a1) plot(a1, a2) end script == You can source it one way: R> source('test.R', keep.source=TRUE) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x'

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Duncan Murdoch
On 12-12-02 5:02 PM, John Sorkin wrote: Gentleman, This thread has been of great interest. Perhaps I missed part of it, but do far I have not seen an example of code that has line numbers that demonstrates how one can (in some instances) recover the line number of an error. Can I impose upon the

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread John Sorkin
Gentleman, This thread has been of great interest. Perhaps I missed part of it, but do far I have not seen an example of code that has line numbers that demonstrates how one can (in some instances) recover the line number of an error. Can I impose upon the people who contributed to this thread to p

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Milan Bouchet-Valat
Le dimanche 02 décembre 2012 à 14:21 -0500, Duncan Murdoch a écrit : > On 12-12-02 9:52 AM, Milan Bouchet-Valat wrote: > > Le dimanche 02 décembre 2012 à 09:02 -0500, Duncan Murdoch a écrit : > >> On 12-12-02 8:33 AM, Milan Bouchet-Valat wrote: > >>> Le dimanche 02 décembre 2012 à 06:02 -0500, Stev

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Duncan Murdoch
On 12-12-02 9:52 AM, Milan Bouchet-Valat wrote: Le dimanche 02 décembre 2012 à 09:02 -0500, Duncan Murdoch a écrit : On 12-12-02 8:33 AM, Milan Bouchet-Valat wrote: Le dimanche 02 décembre 2012 à 06:02 -0500, Steve Lianoglou a écrit : Hi, On Sun, Dec 2, 2012 at 12:31 AM, Worik R wrote: What

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Milan Bouchet-Valat
Le dimanche 02 décembre 2012 à 09:02 -0500, Duncan Murdoch a écrit : > On 12-12-02 8:33 AM, Milan Bouchet-Valat wrote: > > Le dimanche 02 décembre 2012 à 06:02 -0500, Steve Lianoglou a écrit : > >> Hi, > >> > >> On Sun, Dec 2, 2012 at 12:31 AM, Worik R wrote: > >>> What I mean is how do I get the

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Duncan Murdoch
On 12-12-02 8:33 AM, Milan Bouchet-Valat wrote: Le dimanche 02 décembre 2012 à 06:02 -0500, Steve Lianoglou a écrit : Hi, On Sun, Dec 2, 2012 at 12:31 AM, Worik R wrote: What I mean is how do I get the R compilation or execution process to spit out a line number with errors and warnings? Ind

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Duncan Murdoch
On 12-12-02 12:31 AM, Worik R wrote: What I mean is how do I get the R compilation or execution process to spit out a line number with errors and warnings? I should not have mentioned ESS, that is a distraction. I think ESS is not a distraction here, it is the cause of the problem. If you sou

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Milan Bouchet-Valat
Le dimanche 02 décembre 2012 à 06:02 -0500, Steve Lianoglou a écrit : > Hi, > > On Sun, Dec 2, 2012 at 12:31 AM, Worik R wrote: > > What I mean is how do I get the R compilation or execution process to spit > > out a line number with errors and warnings? Indeed, I often suffer from the same probl

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Steve Lianoglou
Hi, On Sun, Dec 2, 2012 at 12:31 AM, Worik R wrote: > What I mean is how do I get the R compilation or execution process to spit > out a line number with errors and warnings? As Duncan mentioned already, you can't *always* get a line number. You can, however, usually get enough context around th

Re: [R] Line numbers with errors and warnings?

2012-12-02 Thread Worik R
What I mean is how do I get the R compilation or execution process to spit out a line number with errors and warnings? I should not have mentioned ESS, that is a distraction. option(error=browser) is a help. But it still does not say what piece of code caused the error. This is costing me a lot

Re: [R] Line numbers with errors and warnings?

2012-11-30 Thread Duncan Murdoch
On 12-11-30 7:15 PM, Worik R wrote: How? This is a script I am running under ess on Emacs I've never used ESS. You'll need to ask someone on the ESS list. Duncan Murdoch (Useful information optuion(error=recover) cheers Worik On Sat, Dec 1, 2012 at 12:34 PM, Duncan Murdoch mailto:murdo

Re: [R] Line numbers with errors and warnings?

2012-11-30 Thread Worik R
How? This is a script I am running under ess on Emacs (Useful information optuion(error=recover) cheers Worik On Sat, Dec 1, 2012 at 12:34 PM, Duncan Murdoch wrote: > On 12-11-30 4:22 PM, Worik R wrote: > >> Is it possible to get a line number with an error report? >> > > Yes, if the error oc

Re: [R] Line numbers with errors and warnings?

2012-11-30 Thread Duncan Murdoch
On 12-11-30 4:22 PM, Worik R wrote: Is it possible to get a line number with an error report? Yes, if the error occurs in code that has line number information. You get line number info by default if you use source(). If the error is deeply buried in code that doesn't have the info (as it may

Re: [R] Line numbers with errors and warnings?

2012-11-30 Thread David Winsemius
On Nov 30, 2012, at 1:22 PM, Worik R wrote: > Is it possible to get a line number with an error report? > > I have a long script and an error: > > Error in `[.xts`(x, xsubset) : subscript out of bounds > > > It would be very helpful, and save a lot of time, if there was some > indication in t

Re: [R] Line numbers with errors and warnings?

2012-11-30 Thread jim holtman
One thing that I do when I have a long script is to put "progress" report messages. These have some comments so I can chart the progress and also print out the current CPU and memory usage so I can also isolate where potential problems might be. This will help narrow down the section of code wher

[R] Line numbers with errors and warnings?

2012-11-30 Thread Worik R
Is it possible to get a line number with an error report? I have a long script and an error: Error in `[.xts`(x, xsubset) : subscript out of bounds It would be very helpful, and save a lot of time, if there was some indication in the error message which line the error was. I can find it using