[R] Ignoring Errors in Simulations

Ken Kelley
2003-11-05T13:27:17Z

Hello all.

I'm doing a simulation study and every so often I get an error that stops
the simulation. I would like to ignore the errors *and* identify the
particular iterations where they occurred. I have tried:

options(error = expression(NULL))

which I thought would ignore the error, but the simulation is still stopped
when an error occurs. I do not think try() is a good idea because of the
significant computational time (that I think) it would add.

Specifically I am using factanal() from the mva library and the error is:

Error in factanal(Data, factors = 1, rotation = "none") :
	Unable to optimize from these starting value(s)
-I am using R 1.7.1 on a Windows XP machine.

Although increasing the number of starting values attempted would reduces
the number or errors, I'm looking for a way that they are ignored and these
(likely) untrustworthy results identified.
Thanks for any thoughts,
Ken