-
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
Suggestion : Add functions for PCA and CA that just call rda()
and cca()
in the background
#655
Comments
You mean these functions? ca <- function(x, ...) cca(x, ...)
pca <- function(x, scale = FALSE, ...) rda(x, scale = scale, ...) |
@jarioksa Yes; I face the same questions every time I have to teach vegan to people. I know it's trivial to write those functions myself, but that doesn't help the students. I was going to propose this in a PR but @cmartin has beaten me to the proposing. Making this change gets my full support and I'll even do the PR if you are OK with it Jari? |
I would also add |
rda()
and cca()
in the background
Yes @jarioksa , that's exactly what I meant. Thanks @gavinsimpson for putting this in action. I can't believe how fast you guys reacted! I should have posted this suggestion YEARS ago LOL |
OK Gav, just go on!. Anyway it's a bit more complicated than my suggestion above: you need to adjust the (printed) call as well. There may be other bits where you need changes for support functions. For |
@jarioksa Will do (and yes, I realize the actual functions will need some messing with the call - things are never that simple :-) For |
See issue #186 which suggests having eigenvalues etc for default |
Another option is to make Please note that it would be possible to call directly ca <- function(x, ....) ordConstrained(x, method="cca", ...)
pca <- function(x, scale = FALSE, ...) ordConstrained(x, method="rda", arg = scale, ...)
pco <- function(d, ...) ordConstrained(d, method = "dbrda", ...) This will set header info and names as well ( pco <- function(d, ...)
{
d <- initDBRDA(d)
ordResid(d)
} This will only return numeric result without janitorial stuff of |
@gavinsimpson I think it is best to implement pco <- function(d, ...) dbrda(d ~ 1, ...) |
These are now implemented in the GitHub (development version). @jarioksa, should these be cherry-picked to 2.6-6.2 so that they will be more immediately avaiable? |
@gavinsimpson yes indeed, I think that these should be cherry-picked Please note that cran-2.6-6 has not moved |
(cherry picked from commit eb65e82)
@jarioksa Done; I think a mid-August release would be good |
Hi,
I'm teaching every year an undergrad course where we use vegan for many useful things (nmds, hclust,kmeans, etc.).
Since this is an undergrad course, we don't go into canonical ordinations, but I like my students to have a constant interface when doing multivariate analysis so we use vegan also for pca and ca, especially since vegan is THE multivariate library to know in ecology.
Every year though, I see the confusion in their eyes that they use a function named for another statistical method because it can do both.
Would it be possible to add both a pca and ca method that just call rda and cca transparently in the background?
Thanks you for your time and great package!
The text was updated successfully, but these errors were encountered: