You want to check out the best
and oneSE
functions in caret
.
I think the simplest way to make it return just the "best" is to modify your example above...
model <- train(RT..seconds.~., data=lipids, method = "lmStepAIC", trControl = ctrl, selectionFunction= "best")
This should work for your example (I hope) as the best
default arguments are just the model with "best" RMSE - of anything more complicated see: help(oneSE)