Skip to content

Commit 4d8d153

Browse files
committed
Merge branch 'issue-369': closes #369 by cherry picking the commit from the 2.5 branch
2 parents 4a77b68 + b5ad0d4 commit 4d8d153

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

R/permutest.betadisper.R

+10-3
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,15 @@
9393
if (!hasClus) {
9494
parallel <- makeCluster(parallel)
9595
}
96-
Pstats <- parRapply(parallel, permutations,
97-
function(x) permFun(x))
96+
97+
Pstats <- parApply(parallel, permutations, 1,
98+
function(x) permFun(x))
99+
if (is.null(dim(Pstats))) {
100+
Pstats <- matrix(Pstats) # one-column matrix
101+
} else {
102+
Pstats <- t(Pstats) # transpose statistics to columns
103+
}
104+
98105
if (!hasClus) {
99106
stopCluster(parallel)
100107
}
@@ -105,7 +112,7 @@
105112

106113
## Process results
107114
F0 <- summary(mod)$fstatistic[1]
108-
Fstats <- Pstats[, 1] # allow empty dim to be dropped
115+
Fstats <- Pstats[, 1, drop = TRUE] # allow empty dim to be dropped
109116
statistic <- F0
110117
names(statistic) <- "Overall (F)"
111118

0 commit comments

Comments
 (0)