Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, …) : NA/NaN/Inf in ‘y’, tried every possible way
The column went_on_backorder is a factor. Linear regression requires a numeric response variable. To use logistic regression, use glm in base R or a package such as vgam. Here’s a brief example: And you can predict your classes: