Error in diffreport -> pval: missing "drop=FALSE"
When I run diffreport on two classes where one of them has just 1 sample and the other one has at least 2 samples, I get this error:
Error in rowSums(!is.na(X[, classlabel == 1])) :
'x' must be an array of at least two dimensions
Calls: diffreport -> diffreport -> .local -> pval -> rowSums
The problem is that with one sample in a class, the expression X[, classlabel == 1] results in a vector. The solution is to add drop=FALSE
Note: it doesn't happen when each class has exactly 1 sample, since in that case T-test and p-value are not calculated at all.
This is xcms 1.36.0