Error in predict function

Issue #165 duplicate
Former user created an issue

Hi Mixomics Team,

Thanks for providing this great stats package.

I am running a splsda on a 16S dataset, with a training and test set (independent to training set of samples). The training set has run fine (not great performance) and now I would like to test on test set.

I am running into the following error:

Error in predict.mixo_spls(Perio.train.splsda, X.test, dist = "mahalanobis.dist") : 'newdata' must include all the variables of 'object$X' In addition: Warning message: In if (all.equal(colnames(newdata), colnames(object$X)) != TRUE) stop("'newdata' must include all the variables of 'object$X'") : the condition has length > 1 and only the first element will be used

I noticed from the previous issues that predict can use another package (pls) but I don't think this is attached in my R session.

Also does the training and test set need to have the same number of variables/OTUs? As this isn't the case.

I am using mixOmics 6.7.2, R version 3.6.0.

Any assistance would be greatly appreciated, thanks

Christina

Comments (1)

  1. Log in to comment