To summarize, we can say that the original (below) is now outdated and sometimes erroneous or misleading.
The proximal problem is that there is no function called predict in the PLS package ; There are some unexplored S3 methods for predict but such predict . Therefore, you cannot import this. predict common lives in the statistics package, and you will need to import them as described below.
Your package must have Depends: pls in DESCRIPTION so that the correct predict method is available for R. There is nothing in pls that you could specifically import.
In addition, you need to import generic predict from the statistics namespace , so add
how it will import common in your package namespace. You will also want to add Imports: stats to your DESCRIPTION file to indicate that you need the stats package; previously we did not need to declare dependencies on the set of basic packages that ship with R (that is, those that are not recommended that ship with R).
original
The main problem here is that PLS does not define the predict function / method. It provides several methods for predict universal, but not the most universal.
You need to import the template from the statistics package, if you need it - I'm not sure that you will do this, because you are not creating a function that needs or is based on the template. At least you need
although you may need / want to import the entire statistics namespace - it depends on what your package is doing, except for the function you are currently working on.
Another problem is that predict.mvr not exported from the pls namespace .
> require(pls) Loading required package: pls Attaching package: 'pls The following object(s) are masked from 'package:stats: loadings > predict.mvr Error: object 'predict.mvr' not found > pls::predict.mvr Error: 'predict.mvr' is not an exported object from 'namespace:pls' > pls:::predict.mvr function (object, newdata, ncomp = 1:object$ncomp, comps, type = c("response", "scores"), na.action = na.pass, ...)
Thus, you cannot just import it. Therefore, your package must have Depends: pls in DESCRIPTION order to find the correct predict method.