Hello! I am attempting to carry out performance assessment on a PLS-DA dataset:
En.GenNoC.plsda.perf <- perf(En.GenNoC.plsda, validation = 'Mfold', folds = 2, progressBar = TRUE, nrepeat = 10)
But keep returning the following error:
Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent
Here is the code I had used to transform my filtered data to plsda format:
En.GenNoC.plsda <- plsda(En.GenNoC.keep, SamplesNoC, logratio = 'CLR', ncomp = 8)
where X = En.GenNoC.keep
, Y = SamplesNoC
.
Below are the dimensions of X (genus reads per sample), which is a list:
> dim(En.GenNoC.keep)
[1] 8 433
> is.list(En.GenNoC.keep)
[1] TRUE
And Y is a factor of sample types with length 8:
> is.factor(SamplesNoC)
[1] TRUE
> length(SamplesNoC)
[1] 8
I am confused by the error message as length of dimnames would be 2 since there a set of dimnames each for the rows and columns:
> length(dimnames(En.GenNoC.keep))
[1] 2
> length(dimnames(En.GenNoC.keep)[2])
[1] 1
There would be no dimnames(Y) as Y is a factor:
> length(dimnames(SamplesNoC))
[1] 0
I had compared my code and data format to the Koren PLS-DA example from the mixOmics workshop and could not find anything different. By the simplicity of the error message, I am probably overlooking something simple, but I’m at a loss as to what needs to be done so I’d appreciate any advice possible.
Thanks very much!