Non-conformable arguments error


I am working on the interaction between different gut microbiota species and different blood parameters.

I am currently facing an issue while running the perf() function in the mixOmics package. The error message I receive is “Error in X.test %*% non-conformable arguments”.

I have proofread my dataset and tried a few troubleshooting steps, but the error persists. I would greatly appreciate any insights or suggestions on how to resolve this issue. Here are the steps I have taken so far:

a. Checked the dataset: I thoroughly reviewed my dataset for any inconsistencies or missing values.
The QA process is as follow:


[1] 41 2027


[1] 41 51





b. Removed near-zero variance predictors: To address any potential collinearity issues, I used the uniqueCut parameter with values of 10, 15, and 20 to remove near-zero variance predictors.

However, the error message continues to appear despite removing the near-zero variance predictors… Hence, I am seeking guidance on possible ways to check my data or any other suggestions to troubleshoot this issue. Your expertise and input would be highly appreciated.

Here is the command I am using:

spls_mod1 ← spls(X = X, Y = Y, ncomp =2, mode = ‘regression’)

perf_spls_mod1 = perf(spls_mod1, validation = “Mfold”, folds = 5, criterion = “all”,
Error in X.test %*% : non-conformable arguments


hi @Yixian_M

It would be hard for me to diagnose as I dont have enough information.

try maybe with folds = 3, or validation = ‘loo’. I wonder if during the cross-validation process for a particular fold you are loosing some variables in X (there is an internal nzv process in the folds too when there are too many zeroes).


Hi @kimanh.lecao

Many thanks for your reply and suggestions.

I tried changing the folds to 3 and the validation to ‘loo’, but I still got the same error message. I wonder if there is something wrong with my data or the function.

I have attached my edited data for your reference, it is a rank-normalized data. Do you mind take a look and let me know if you see anything unusual?

Thanks again.