I'm glad it was what you were looking for! I am not a genius, just somebody who has been down the same path before
I'm not super well versed with base plot()
so I'm not sure waht the Error in e2[[j]] : subscript out of bounds
is from.
For the ggplot()
error, it is stating that
Error in FUN(X[[i]], ...) : object 'predicted' not found
And we are using :
geom_point(data = unknowns, aes(abs, predicted), colour = "tomato") +
So either the unknowns
data frame hasn't been created prior to the ggplot
call, or you haven't added the predicted
values using this line of code:
# using the model, 'predict' what the values would be given particular measurements
unknowns$predicted <- stats::predict(model, unknowns)
Do you definitely have these lines before the ggplot
call?