[R] Completely ignoring an error in a function...

2012-10-17 Thread Jonathan Greenberg
The code base is a bit too complicated to paste in here, but the gist of my question is this: given I have a function myfunction - function(x) { # Do something A # Do something B # Do something C } Say #Do something B returns this error: Error in cat(list(...), file, sep, fill, labels, append) :

Re: [R] Completely ignoring an error in a function...

2012-10-17 Thread Sarah Goslee
I'd wrap it in try() - the failing function will run, and you can check after the fact whether it failed or not. Sarah On Wed, Oct 17, 2012 at 3:48 PM, Jonathan Greenberg j...@illinois.edu wrote: The code base is a bit too complicated to paste in here, but the gist of my question is this:

Re: [R] Completely ignoring an error in a function...

2012-10-17 Thread Pieter Schoonees
Have a look at example(try) and demo(error.catching) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Greenberg Sent: Wednesday, October 17, 2012 21:48 To: r-help Subject: [R] Completely ignoring an error in a function