od <- options(digits = 4)
## load the data sets
data(beetles)
data(plants)
## log transform the bettle data
beetles <- log(beetles + 1)
## predictive CoCA using SIMPLS and formula interface
bp.pred <- coca(beetles ~ ., data = plants)
## should retain only the useful PLS components for a
## parsimonious model
## Leave-one-out crossvalidation - this takes a while
if (FALSE) {
crossval(beetles, plants)
}
## so 2 axes are sufficient
options(od)
Run the code above in your browser using DataLab