[R] Error with permutest on dbrda object in vegan

Cleo Tebby cleotebby at gmail.com
Tue Sep 13 16:55:51 CEST 2016


Dear all,

I am using distance-based RDA in vegan 2.4-1 with direct decomposition
(no constant added, imaginary axes included) and trying to test axis
significance. Permutations seem to work with first=FALSE, but not
first=TRUE. The error message is "invalid comparison with complex
values".

Here is my code:

library(vegan)
data(pyrifos)
ditch <- gl(12, 1, length=132)
week <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24))
dose <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11))
res_rda_pyrifos_inv_BC<-dbrda(pyrifos~interaction(week,dose) +
Condition(week), distance = "bray")
ctrl_pyrifos <- how(plots = Plots(strata = ditch,type = "free"),
within = Within(type = "series"), nperm = 99)
permutest(res_rda_pyrifos_inv_BC,  permutations=ctrl_pyrifos, first=TRUE)

I get this message:

"Permutation test for dbrda

Plots: ditch, plot permutation: free
Permutation: series
Number of permutations: 9999

Call: dbrda(formula = pyrifos_inv_raw ~ interaction(week, dose) +
Condition(week), distance = "bray")
Error in x$F.perm >= x$F.0 - EPS : invalid comparison with complex values"

Any help would be appreciated!
Thanks,
Cleo Tebby



More information about the R-help mailing list