on-internet
← Community

Error in R: no applicable method for 'predict' applied to an object of class "regsubsets"

Stack Overflow ·

I was trying to run codes from textbook ISLR. It is about Best Subset Selection: library(ISLR) #contain data Hitters library(leaps) #use regsubsets regfit.full=regsubsets(Salary~.,Hitters) predict(regfit.full) Then R showed error: Error in UseMethod("predict") :no applicable method for 'predict' applied to an object of class "regsubsets" I am using Windows RStudio Version 0.99.893, R-3.2.4revised-win. I really have no idea why the "predict" cannot apply to "regsubsets". other info: > sessionInfo() R version 3.2.4 Revised (2016-03-16 r70336) Platform: x86_64-w64-mingw32/x64 (64-bit) Running und

Comments

Sign in or sign up to comment and upvote.

No comments yet.