If you elect r package pls,
http://cran.r-project.org/web/packages/pls/index.html
data(yarn)
## Default methods:
yarn.pcr
yarn.pls
yarn.cppls
## Alternative methods:
yarn.oscorespls
method = "oscorespls")
yarn.simpls
method = "simpls")
## Not run:
## Parallelised cross-validation, using transient cluster:
pls.options(parallel = 4) # use mclapply
pls.options(parallel = quote(makeCluster(4, type = "PSOCK"))) # use parLapply
## A new cluster is created and stopped for each cross-validation:
yarn.pls
yarn.pcr
## Parallelised cross-validation, using persistent cluster:
library(parallel)
## This creates the cluster:
pls.options(parallel = makeCluster(4, type = "PSOCK"))
## The cluster can