I am trying to do a ridge regression using the codes below with GenCont data in the library ridge
library(ridge)
data(GenCont)
GenCont_df <- as.data.frame(GenCont)
GenCont_df$SNP1 <- as.factor(GenCont_df$SNP1)
mod2 <- linearRidge(Phenotypes ~ SNP1+SNP2, data = GenCont_df)
predict(mod2, GenCont_df, na.action = na.pass, all.coef = FALSE,scaling ="scale")
But if I used dummy variables in the model I get this error
Error in X[, ll] : subscript out of bounds
Is there a way to predict dummy variables in Ridge regression in R?