Using the package earth, I have a number of models and I would like to call a model up by its index number.
I have tried using a list but this does not work.
a <- list(a)
a[1] <- earth(Volume ~ ., data = trees1)
a[2] <- earth(Volume ~ ., data = trees2)
a[3] <- earth(Volume ~ ., data = trees3)
I would be grateful for your help.
Try this:
You will generally want to access the contents with “[[” as well.