Sander Oom wrote:
An interesting thought just came to me when reading this discussion! I use both R and Latex and have never had the trouble of overlooking error messages when debugging long Latex code!

Of course this is because when compiling a latex document, a summary of the compilation process is provided at the end! If any errors occurred, they will be mentioned in the summary.

Maybe R could provide the same summary as an optional part of the source() command!?


I think it does, doesn't it? R will stop at the first error and print it, e.g.

> source('c:/temp/test.R')
Error in parse(file, n = -1, NULL, "?") : syntax error on line 4

 If there were only warnings, it will show them at the end:

> source('c:/temp/test.R')
Warning messages:
1: longer object length
        is not a multiple of shorter object length in: 1:3 + 1:4
2: longer object length
        is not a multiple of shorter object length in: 1:3 + 1:4

Even if you use echo=TRUE, these summaries show up at the end. It's only if you use cut and paste that you might miss these.

Duncan Murdoch

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to