Dear Team,
I’m trying to use multilevel PLSDA for metabolomics data and get an error on ‘rowSums’ every time I add the multilevel argument. Simple PLSDA works fine. Kindly help me!
Below is the error reproduced using the mixOmics package example. I’m using the R version 4.3.0 (2023-04-21) and mixOmics version 6.24.0.
suppressMessages(library(mixOmics))
data(vac18)
X ← vac18$genes
Y ← vac18$stimulation
design ← data.frame(sample = vac18$sample)
res ← plsda(X,Y,multilevel = design)
Error in rowSums(Y) : ‘x’ must be an array of at least two dimensions
Traceback:
traceback()
6: stop(“‘x’ must be an array of at least two dimensions”)
5: rowSums(Y)
4: which(rowSums(Y) == 0)
3: Check.entry.pls(X, Y, ncomp, keepX, keepY, mode = mode, scale = scale,
near.zero.var = near.zero.var, max.iter = max.iter, tol = tol,
logratio = logratio, DA = DA, multilevel = multilevel)
2: internal_wrapper.mint(X = X, Y = Y.mat, ncomp = ncomp, scale = scale,
near.zero.var = near.zero.var, mode = “regression”, max.iter = max.iter,
tol = tol, logratio = logratio, multilevel = multilevel,
DA = TRUE, all.outputs = all.outputs)
1: plsda(X, Y, multilevel = design)