# NOT RUN {
## data
data("AirPollution", package = "lmSubsets")
#################
## lmSubsets ##
#################
lm_all <- lmSubsets(mortality ~ ., data = AirPollution, nbest = 20)
## heatmap
image(lm_all, best = 1:3)
## highlight 5 best (BIC)
image(lm_all, best = 1:3, hilite = 1:5, hilite_penalty = "BIC")
################
## lmSelect ##
################
## default criterion: BIC
lm_best <- lmSelect(lm_all)
## highlight 5 best (AIC)
image(lm_best, hilite = 1:5, hilite_penalty = "AIC")
## axis labels
image(lm_best, lab = c("bold(lab)", "lab"), hilite = 1,
lab_hilite = "underline(lab)")
# }
Run the code above in your browser using DataCamp Workspace