-
Notifications
You must be signed in to change notification settings - Fork 96
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 currently ignores choices argument #190
Comments
goodness.cca
currently ignores choices
argument
Referencing this issue and example in #189, any reason why you cannot have contributions to unconstrained axes? That is, beyond CCA |
@smikhaylov Maybe I wasn't thinking this through clearly enough... I suppose it makes no difference whether the particular linear combination is constrained or not when computing this, but the current code separates them into This is not to say that we couldn't |
I think either way would work fine. |
Dropping There are numerous examples how this has been done in vegan. Mere |
I opened up branch issue-#190 in vegandevs/vegan to put back
Some of these choices do differ from the pre-2.4-0 version. In old Both in the old and in the new proposed code, subsetting was only within the component and would not extend to, say, from constrained to unconstrained if |
I think it makes sense. Probably just needs adjusting documentation now. The use of devtools::install_github("vegandevs/vegan", ref = "4026ba4")
library(vegan)
words <- read_csv("words.csv")
env <- read_csv("env.csv")
cca <- cca(words ~ Idealpoint, data = env)
goodness(cca) #contribution to inertia on CCA1
goodness(cca, choices = 1:3) #produces only contribution to inertia on CCA1
goodness(cca, model = c("CCA", "CA"), choices=1:3) #produces only contribution to inertia on CCA1
#so to go for unconstrained axes you need to specify `model`
goodness(cca, model = "CA", choices=1:3)
#not specifying the `model` results in a warning message and null vector of results
goodness(cca, choices=2:3)
Warning message:
In sweep(CA, 1, tot, "/") :
STATS is longer than the extent of 'dim(x)[MARGIN]' So I think it works fine, just documentation needs to be adjusted, particularly about the |
As mentioned in the discussion surrounding #189, the
choices
argument it not used ingoodness.cca
.It seems that in the transition from the old
goodness.cca
code to the one that wasgoodness2.cca
this functionality got lost. Originally we had:but this is not in the newer (current) version for the code.
This is clearly a bug, but do we want to return the original
choices
functionality or update the documentation.If we reinstate the functionality, it seems we need a better check that just not being
missing
; in the example in #189 there is only a single constrained axis so asking forchoices = 1:3
doesn't make sense.The text was updated successfully, but these errors were encountered: