# NOT RUN {
if (require("pls")) {
data(gasoline, package = "pls")
## usually more than 50 iterations are needed
SAobj <- SAfun(gasoline$NIR, gasoline$octane,
eval.fun = pls.cvfun, Tinit = 3,
fraction = .02, niter = 50, ncomp = 2)
SAobj
} else {
cat("Package pls not available.\nInstall it by typing 'install.packages(\"pls\")'")
}
# }
Run the code above in your browser using DataLab