these are my variables:
> dput(y) c(-22.0713165394207, 14.0880914427811, 10.9650636244176, -1.96648890706268, -5.30593850426708, -7.54651916037787, 3.8491474
We can convert the infinite values to NA and it should work
NA
x[is.infinite(x)] <- NA summary(lm(y ~ x))