Suppose I have data.frame a
And I am using following code
m.fit <- lm(col2 ~ col3 * col4, na.action = na.exclude)
Here the col2 has some NA values And col3,col4 have values less than 1.
I am getting following error:
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in foreign function call (arg 1)
I have also checked the mailing list and I found that the error is because of the NA values present in col2 I also tried using na.action=na.exclude/omit/pass but none of them seem to work. I have tested lm again on the first 10 entries, definitely not because of the NAs. Problem with this warning is interpreted by every google results is pointing towards the NA values.
Have I misinterpreted the error ?