Hi all,

I don't understand what's wrong with this code. I'm trying to create a vector with the test MSE values for 5 degrees of polynomial linear function when I am getting this error. It should be quite straightforward, but maybe there's something wrong with the loop itself. I don;t understand why it says it can't find the model. Any help will be appreciated

```
library(ISLR)
library(boot)
#> Warning: package 'boot' was built under R version 3.5.2
cv_error_5=rep(0,5)
for (i in 1:10) {linear_model=glm(mpg ~ poly(horsepower, i), data=Auto) + cv_error_5[i]=cv.glm(data=Auto, linear_model)$delta[1]}
#> Error in cv.glm(data = Auto, linear_model): object 'linear_model' not found
```

^{Created on 2019-10-12 by the reprex package (v0.3.0)}