-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
goodness.cca #189
Comments
This is a bug. I'll fix it asap. The bug can be triggered with standard vegan data: library(vegan)
data(dune, dune.env)
# these both fail
goodness(cca(dune ~ A1, dune.env))
goodness(rda(dune ~ A1, dune.env)) The error appears when constraints have rank=1. It looks like one of the classic R gotchas: what happens with |
Fixed with 07f1857. Thanks for reporting the bug. |
That's great. Thanks for dealing with it so quickly. Are you going to push to CRAN an update? |
Hi Jari, The build directly from GitHub is failing. So I used a local source with updated source("goodness.cca.R")
words <- read_csv("words.csv")
env <- read_csv("env.csv")
cca <- cca(words ~ Idealpoint, data = env)
goodness.cca(cca, addprevious = TRUE)
Error in diag(w) %*% CCA^2 %*% diag(object$CCA$eig) :
non-conformable arguments
4 is.data.frame(x)
3 rowSums(diag(w) %*% CCA^2 %*% diag(object$CCA$eig))
2 inertcomp(object, display = display) at goodness.cca.R#42
1 goodness.cca(cca, addprevious = TRUE) |
You also need to upgrade the If you upgrade these functions by sourcing, you may also need to take care that they are in the vegan environment and replace the original functions that were locked into vegan namespace when loading vegan: source("goodness.cca.R")
source("inertcomp.R")
environment(goodness.cca) <- enviroment(dbrda) # or any function in vegan NAMESPACE
environment(inertcomp) <- environment(dbrda)
assignInNamespace("goodness.cca", goodness.cca, "vegan")
assignInNamespace("inertcomp", inertcomp, "vegan") You may not need all these tricks, but sometimes you do -- depends on the kind of functions. About inability to build vegan from github: do you have C and Fortran compilers? |
Ok, perfect. My mistake with the Fortran compiler. One small thing, the "choices" option is not functional any more? (Just running from my earlier example data/code, but with 2.5 version) goodness(cca, display="sites", choices=c(1,2,3)) This produces contributes only for the constrained dimension (CCA1). |
It looks like if (!missing(choices))
vexp <- vexp[, choices, drop = FALSE] It's not immediately clear to me what |
Hi I was running a CCA model, calling goodness() afterwards returns an error
"Error in diag(w) %*% CA^2 %*% diag(eig) : non-conformable arguments".
Replicable code below:
Data:
data.zip
Code:
The text was updated successfully, but these errors were encountered: