I have dataset that has two factors in it. When i try to run stepwise on this i get the error that the 'list' cannot be coerced to type 'double'. I have verified these are factors and are not a 'list'. When i remove the factors from the dataset i can run the stepwise without any issues.
Currently running 2023.03.0 Build 386 on MAC OS and on a Windows Laptop. Same results on both machines.
sapply(bdata,class)
Team League Year RS RA W
"factor" "factor" "numeric" "numeric" "numeric" "numeric"
OBP SLG BA Playoffs
"numeric" "numeric" "numeric" "numeric"step_results <- stepwise(RS ~.,
-
data = bdata,
-
select = "adjRsq")
Error in is.factor(x) : 'list' object cannot be coerced to type 'double'