Displaying 1 result from an estimated 1 matches for "_message_".
Did you mean:
_message
2005 May 24
1
Catching an error with lm()
Folks,
I'm in a situation where I do a few thousand regressions, and some of
them are bad data. How do I get back an error value (return code such
as NULL) from lm(), instead of an error _message_?
Here's an example:
> x <- c(NA, 3, 4)
> y <- c(2, NA, NA)
> d <- lm(y ~ x)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
0 (non-NA) cases
> str(d)
Error in str(d) : Object "d" not found
My question is: How do I force lm() to...