I am currently trying to run a dbRDA using the vegan package. I used three explanatory matrices to explain one response distance matrix:
full.rda <- dbrda(bsim ~ genmat + envmat + spamat)
The first one is a distance matrix while the last three are matrices (not data frames). I checked the dimnames attributes of each, no missing values either, overall everything seems ok...
dim(bsim)
[1] 380 380
dim(envmat)
[1] 380 6
dim(spamat)
[1] 380 3
dim(genmat)
[1] 380 2
all(attr(genmat, 'dimnames')[[1]] == attr(bsim, 'dimnames')[[1]])
[1] TRUE
all(attr(spamat, 'dimnames')[[1]] == attr(bsim, 'dimnames')[[1]])
[1] TRUE
all(attr(envmat, 'dimnames')[[1]] == attr(bsim, 'dimnames')[[1]])
[1] TRUE
but for some reason here the error message I get :
full.rda <- dbrda(bsim ~ genmat + envmat + spamat)
Error in dimnames(u) <- list(dnam[[1]], c(axnam, negnam)) : length of 'dimnames' [2] not equal to array extent
traceback()
3: ordConstrain(Y, X, Z)
2: ordConstrained(X, d$Y, d$Z, method = "dbrda")
1: dbrda(bsim ~ genmat + envmat + spamat)
I've seen people got this error when they were trying to do a corrplot and use a data frame instead of a matrix but that is not the issue here..
Is there anyone who might have suggestions or ideas to overcome this issue ?
I am using the version 3.5.1 of R and the version 2.5-2 of the vegan package.
Thank you a lot!