SyntaxFix
Write A Post
Hire A Developer
Questions
You can check the package leaps and in particular the function regsubsets() functions for model selection. As stated in the documentation:
leaps
regsubsets()
Model selection by exhaustive search, forward or backward stepwise, or sequential replacement