Ridge regression is not a variety of subset selection. Ridge regression keeps all the variables in the model (thus there is no selection) but shrinks their coefficients towards zero. Using ridge regression makes sense if all the variables are somewhat important but estimating their effects via OLS yields too large a model variance. If you want not only shrinkage but also variable selection, you may look at LASSO or elastic net instead.
Ridge regression, LASSO and elastic net are implemented in R package "glmnet". In the function glmnet
specify the argument alpha=0
to get a ridge regression, alpha=1
for LASSO, and alpha
in between zero and one for elastic net regression.