Re: [R] Question regarding if statement in while loop

2010-01-06 Thread Stephanie Coffey
Stephan, Patrick & Carl, Thanks very much for your help...and during the holidays no less! Putting my function within a try() worked perfectly!! Happy New Year, Stephanie On Sat, Dec 26, 2009 at 1:38 PM, Stephan Kolassa wrote: > Hi Stephanie, > > it sounds like R's exception handling may help,

Re: [R] Question regarding if statement in while loop

2009-12-26 Thread Carl Witthoft
Sounds like what you want is either try() or trycatch() -- check out the documentation. Basically, putting your eblest() function inside a try() call allows you to return an error message if eblest crashes without crashing your main loop. BTW, for debugging purposes, I'd recommend creat

Re: [R] Question regarding if statement in while loop

2009-12-26 Thread Stephan Kolassa
Hi Stephanie, it sounds like R's exception handling may help, something like this: foo <- try(eblest(i, dir5, sterr5, weight5, aux5)) if ( class(foo) == "try-error" ) next Take a look at ?try. HTH, Stephan Stephanie Coffey schrieb: Hi all, I'm running R version 2.9.2 on a PC. I'm having a