Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread luke
Kurt Hornik and I have discussed off an on a mechanism for setting default condition handlers. So far we haven't come up with anything satisfactory but we may yet. In some ways this would be easier if the top level was written in R, along the lines of .Program, so I've played around with that a

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread William Dunlap
In SV3 (or Splus prior to 5.0) one could redefine the .Program expression, which by default was close to print(eval(parse(stdin())) along with some extras like printing warnings and errors in certain ways and recording input in a .Audit file. I once wrote toy .Programs that used select() to liste

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread Jon Clayden
Jeff, Hadley, Many thanks for your responses. The eval.with.details package sounds interesting and I'll certainly take a closer look, but it still seems to me that these approaches are focussed on trapping warnings within specific snippets of code rather than changing the way all warnings (includi

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread hadley wickham
Hi Jon, I have an in-development package that attempts to do this. It's called eval.with.details and is available from http://github.com/hadley/eval.with.details. As you might guess, it's a version of eval that captures all details like messages, warnings, errors and output so you can do whateve

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread Jeffrey Horner
Jeffrey Horner wrote on 02/04/2009 01:19 PM: Jon Clayden wrote on 02/04/2009 12:11 PM: Dear Jeff, Many thanks for the suggestion, but I don't think tryCatch() is the answer, mainly because it causes code to stop executing when a warning is signalled: f <- function(w) print(w$message) tryCatch

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread Jeffrey Horner
Jon Clayden wrote on 02/04/2009 12:11 PM: Dear Jeff, Many thanks for the suggestion, but I don't think tryCatch() is the answer, mainly because it causes code to stop executing when a warning is signalled: f <- function(w) print(w$message) tryCatch({warning("Test"); print(3)},warning=f) [1] "

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread Jon Clayden
Dear Jeff, Many thanks for the suggestion, but I don't think tryCatch() is the answer, mainly because it causes code to stop executing when a warning is signalled: > f <- function(w) print(w$message) > tryCatch({warning("Test"); print(3)},warning=f) [1] "Test" (The "print(3)" call is not run.) I

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread Jeffrey Horner
Jon Clayden wrote on 02/04/2009 06:59 AM: Dear all, For an open-source project that I'm working on (1), which uses R for all its heavy lifting but includes a wrapper shell script, I was hoping to find a way to capture all warnings (and, in fact, errors too), and handle them in my own way. I r

[Rd] Problem using option packeg with new R version (PR#13498)

2009-02-04 Thread كبريــاء فتــــاة
Hello, I'm facing a problem, using "optim" packeg. I've written a program and run it using the latest R version 2.8.1,but there was an error message as following: R version 2.7.2 (2008-08-25) # same result when I use R version 2.8.1,Copyright (C) 2008 The R Foundation for Statistical Compu

[Rd] [SoC 2009] will R Foundation participate? project proposal: fractal analysis

2009-02-04 Thread Anne Ghisla
Hello R developers, I know it is still a bit early to talk about Summer of Code, but I wish to know what are, approximately, plans for this year. Last year I applied as a student under OSGeo with a QGIS-R project and had a very positive experience [0], therefore I plan to participate again. I fo

[Rd] Capturing all warnings (with messages)

2009-02-04 Thread Jon Clayden
Dear all, For an open-source project that I'm working on (1), which uses R for all its heavy lifting but includes a wrapper shell script, I was hoping to find a way to capture all warnings (and, in fact, errors too), and handle them in my own way. I realise I can do this for a single expr