[R] Query about using optimizers in R without causing program to crash

lalitha viswanath lalithaviswanath at yahoo.com
Mon Jan 22 21:43:28 CET 2007


Hi
I am a newbie to R and am using  the lm function to
fit my data.
This optimization is to be performed for around 45000
files not all of which lend themselves to
optimization. Some of these will and do crash.
 
However, How do I ensure that the program simply goes
to the next file in line without exiting the code with
the error
"Error in lm.fit(x, y, offset = offset, singular.ok =
singular.ok, ...) : 
        NA/NaN/Inf in foreign function call (arg 4)"
everytime it encounters troublesome data?

I would greatly appreciate your input as it would
avoid me having to manually type
for fileId in (c(4351:46000)) { ... }
for fileId in (c(5761:46000)) { ... }, etc...

Thanks
Lalitha


 
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels



More information about the R-help mailing list