# NOT RUN {
if (require("pls")) {
data(gasoline, package = "pls")
## Usually more iterations are needed
GAobj <- GAfun(gasoline$NIR, gasoline$octane,
eval.fun = pls.cvfun, niter = 20,
kmin = 3, kmax = 25, ncomp = 2)
GAobj
} else {
cat("Package pls not available.\nInstall it by typing 'install.packages(\"pls\")'")
}
# }
Run the code above in your browser using DataLab