# \dontshow{
suppressWarnings(RNGversion("3.5.0"))
od <- options(digits = 4)
# }
## load some data
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
# \donttest{
## Leave-one-out crossvalidation - this takes a while
crossval(beetles, plants)
## so 2 axes are sufficient
# }
## permutation test
## (Testing the first 2 axes & only 25 perms for speed.)
bp.perm <- permutest(bp.pred, permutations = 25, n.axes = 2)
bp.perm
options(od)
Run the code above in your browser using DataLab