idx <- sort(apply(prob.pathways.sig, 3, sum), decreasing=TRUE, index.return = TRUE)$ix In order to solve this issue, the argument drop=F can be added in the step when the matrix of significant pathways are subsetted from all of the probability pathways @sqjin if you could kindly ad...