Linear model function lm() error: NA/NaN/Inf in foreign function call (arg 1)

后端 未结 10 1207
天涯浪人
天涯浪人 2020-12-03 09:49

Say I have data.frame a

I use

m.fit <- lm(col2 ~ col3 * col4, na.action = na.exclude)

col2 has some <

10条回答
  •  囚心锁ツ
    2020-12-03 10:34

    I solved this type of problem by resetting my options. options(na.action="na.exclude") or options(na.action="na.omit")

    I checked my settings and had previously changed the option to "na.pass" which didn't drop my y observations with NAs (where y~x).

提交回复
热议问题