Using mixOmics 6.1.1, I get the following error when attempting to tune the number of variables to retain on each component in an splsda model. Using the srbct data:
X<srbct$gene Y<srbct$class tune<tune.splsda(X,Y,ncomp=3, folds=5)
0%Error in if (ncol(newx) != p & ncol(newx) != length(A)) { : argument is of length zero
other_tune<tune(method="splsda",X,Y,ncomp=3,folds=5) Calling 'tune.splsda'   0%Error in if (ncol(newx) != p & ncol(newx) != length(A)) { : argument is of length zero
I'm not sure I understand the nature of this error. In the above data, dim(X)[1]==length(Y).
Comments (4)


Florian, Thank you for for the help. It appears that there was indeed a clash with another package. Both tune.splsda and the tune wrapper function are working appropriately now for discriminant analysis.
However, when I move over to using the tune wrapper to choose the number of variables to retain on each component of a sPLS model, I get the following:
X < liver.toxicity$gene Y < liver.toxicity$clinic tune<tune(method="spls", X=X, Y=Y, ncomp=2,folds=5, nrepeat=100)
Calling 'tune.multilevel' with method = 'spls' Error in tune.multilevel(X = X, Y = Y, multilevel = multilevel, mode = mode, : argument "multilevel" is missing, with no default
I understand this pertains to tuning a multilevel model for repeated measurements. I am unsure what to supply in the given case, where data are representative of only one time point.

repo owner Hello, The tune does not apply for a sPLS method (as it is a bit tricky to tune). We'll fix that in the next update. Best is to use the function perf that measures the performance of sPLS in a multivariate context. See example in ?perf

 changed status to resolved
 Log in to comment
Hi There,
This seems to be a clash with another package because there is no "newx" string in any of the mixOmics code. I would imagine that restarting R, and only loading mixOmics and the srbct data would do the trick.
Please advise whether this is working