Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Provide less verbose output in `summary.foo` for ordinations #203
Comments
gavinsimpson
added the
feature-request
label
Oct 5, 2016
gavinsimpson
self-assigned this
Oct 5, 2016
|
For the record, here a directory listing of
Most summarizing functions were introduces only later ( |
|
Here some summarizing vegan functions that could be a part of new |
|
First we should decide what we want to have in I'm satisfied with the current |
|
A quick fix to cut down the volume but keep the current design is diff --git a/R/print.summary.cca.R b/R/print.summary.cca.R
index 180220e..a59fdeb 100644
--- a/R/print.summary.cca.R
+++ b/R/print.summary.cca.R
@@ -1,5 +1,5 @@
`print.summary.cca` <-
- function (x, digits = x$digits, head=NA, tail=head, ...)
+ function (x, digits = x$digits, head=3, tail=head, ...)
{
hcat <- function(x, head=head, tail=tail, ...) {
if (!is.na(head) && !is.na(tail) && head+tail+4 < nrow(x))
diff --git a/R/print.summary.decorana.R b/R/print.summary.decorana.R
index 1326697..d481702 100644
--- a/R/print.summary.decorana.R
+++ b/R/print.summary.decorana.R
@@ -1,5 +1,5 @@
`print.summary.decorana` <-
-function (x, head=NA, tail=head, ...)
+function (x, head=3, tail=head, ...)
{
digits <- x$digits
hcat <- function(x, head=head, tail=tail, ...) {
diff --git a/man/decorana.Rd b/man/decorana.Rd
index 686d2e4..84dcafe 100644
--- a/man/decorana.Rd
+++ b/man/decorana.Rd
@@ -30,7 +30,7 @@ decorana(veg, iweigh=0, iresc=4, ira=0, mk=26, short=0,
\method{summary}{decorana}(object, digits=3, origin=TRUE,
display=c("both", "species","sites","none"), ...)
-\method{print}{summary.decorana}(x, head = NA, tail = head, ...)
+\method{print}{summary.decorana}(x, head = 3, tail = head, ...)
downweight(veg, fraction = 5)
diff --git a/man/plot.cca.Rd b/man/plot.cca.Rd
index 2fe4db5..8e090c6 100644
--- a/man/plot.cca.Rd
+++ b/man/plot.cca.Rd
@@ -35,7 +35,7 @@
display = c("sp", "wa", "lc", "bp", "cn"),
digits = max(3, getOption("digits") - 3),
correlation = FALSE, hill = FALSE, ...)
-\method{print}{summary.cca}(x, digits = x$digits, head = NA, tail = head, ...)
+\method{print}{summary.cca}(x, digits = x$digits, head = 3, tail = head, ...)
\method{head}{summary.cca}(x, n = 6, tail = 0, ...)
\method{tail}{summary.cca}(x, n = 6, head = 0, ...)
}I haven't committed these changes. It is unnecessary, since the change can be tested using |
|
I was thinking along the lines of:
|
|
An alternative would be to keep the current |
|
I think that the length of I would suggest deprecation of Currently A historic note about having Call:
decorana(veg = dune)
Detrended correspondence analysis, with 26 segments.
Rescaling of axes with 4 iterations.
DCA1 DCA2 DCA3 DCA4
Eigenvalues 0.5117 0.3036 0.1213 0.1427
Axis lengths 3.7004 3.1166 1.3005 1.4789This shows the essential information on call, used options and the results, including diagnostic statistics on axes. The Call:
cca(X = varespec, Y = varechem[, 1:3])
Mean squared contingency coefficient: 2.0832
Constrained: 0.4464 ( rank 3 )
Unconstrained: 1.6368 ( rank 20 )
Eigenvalues for constrained axes:
CCA1 CCA2 CCA3
0.1931 0.1627 0.0906
Eigenvalues for unconstrained axes:
CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8
0.44953 0.28701 0.18772 0.16748 0.12805 0.10497 0.07497 0.06287
(Showed only 8 of all 20 unconstrained eigenvalues)(This does not quite work with modern "summary.cca" <-
function(object)
{
structure(
list("class" = class(object),
"methods" = methods(class = "cca")),
class = "summary.cca")
}
"print.summary.cca" <-
function(x, ...)
{
cat("object of class", paste(x$class, collapse = ", "), "\n\n")
cat("use following methods to extract or analyse the result:\n\n")
print(x$methods)
} |
|
I would keep the > summary(mod, display = NULL)
Call:
cca(formula = dune ~ Management, data = dune.env)
Partitioning of mean squared contingency coefficient:
Inertia Proportion
Total 2.1153 1.0000
Constrained 0.6038 0.2855
Unconstrained 1.5114 0.7145
Eigenvalues, and their contribution to the mean squared contingency coefficient
Importance of components:
CCA1 CCA2 CCA3 CA1 CA2 CA3 CA4 CA5 CA6
Eigenvalue 0.3186 0.18247 0.10274 0.4474 0.20300 0.16301 0.13457 0.12940 0.09494
Proportion Explained 0.1506 0.08626 0.04857 0.2115 0.09597 0.07706 0.06362 0.06117 0.04488
Cumulative Proportion 0.1506 0.23690 0.28547 0.4970 0.59294 0.67000 0.73362 0.79479 0.83968
CA7 CA8 CA9 CA10 CA11 CA12 CA13 CA14 CA15
Eigenvalue 0.07904 0.06526 0.05004 0.04321 0.0387 0.02385 0.01773 0.009172 0.007959
Proportion Explained 0.03737 0.03085 0.02366 0.02043 0.0183 0.01128 0.00838 0.004340 0.003760
Cumulative Proportion 0.87704 0.90790 0.93155 0.95198 0.9703 0.98155 0.98994 0.994270 0.998030
CA16
Eigenvalue 0.004157
Proportion Explained 0.001970
Cumulative Proportion 1.000000
Accumulated constrained eigenvalues
Importance of components:
CCA1 CCA2 CCA3
Eigenvalue 0.3186 0.1825 0.1027
Proportion Explained 0.5277 0.3022 0.1701
Cumulative Proportion 0.5277 0.8299 1.0000
Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensionsPerhabs, if display = NULL, the last three lines could be skipped? So that it looks like: Call:
cca(formula = dune ~ Management, data = dune.env)
Partitioning of mean squared contingency coefficient:
Inertia Proportion
Total 2.1153 1.0000
Constrained 0.6038 0.2855
Unconstrained 1.5114 0.7145
Eigenvalues, and their contribution to the mean squared contingency coefficient
Importance of components:
CCA1 CCA2 CCA3 CA1 CA2 CA3 CA4 CA5 CA6
Eigenvalue 0.3186 0.18247 0.10274 0.4474 0.20300 0.16301 0.13457 0.12940 0.09494
Proportion Explained 0.1506 0.08626 0.04857 0.2115 0.09597 0.07706 0.06362 0.06117 0.04488
Cumulative Proportion 0.1506 0.23690 0.28547 0.4970 0.59294 0.67000 0.73362 0.79479 0.83968
Accumulated constrained eigenvalues
Importance of components:
CCA1 CCA2 CCA3
Eigenvalue 0.3186 0.1825 0.1027
Proportion Explained 0.5277 0.3022 0.1701
Cumulative Proportion 0.5277 0.8299 1.0000But actually, I don't get @tpoisot complaints... |
|
@EDiLD the issue with current |
|
OK, but isn't that what |
|
@gavinsimpson : I really think there currently is a |
|
@EDiLD That's a side effect; it's not the default so you get bitten by huge output until you've been bitten enough times to remember, assuming you work it out, to use @jarioksa re I don't think that the correct place to educate users about the availability of methods for ordination classed objects is the output of I don't think we need to remove
Optionally it would include a list of the types of scores available, say something like the way Site (WA) Site (LC) Species Biplot Centroid
TRUE TRUE TRUE FALSE TRUEIt also strikes me that |
|
By adding to the |
|
@gavinsimpson : it is indeed important to make a difference between
(This R fix will improve some of the vegan output and make some earlier tweaks no longer necessary.) Removing or radically changing The modern Big Data applications mean that we really should have some truncation in several |
|
@jarioksa If people have used I'm not sold on truncating If you had a linear regression model with 100 coefficients, |
|
@gavinsimpson : using |
|
@jarioksa I don't disagree with what you write. You should be able to extract the data as the underlying R objects that get printed via the Where I disagree with the line of reasoning is, just because in the past people have used It's not like anyone is proposing to delete |
|
@gavinsimpson , I agree with |
|
OK, let me implement something in a branch and do a PR. We can discuss the detail and implementation there referencing this thread/issue. |
gavinsimpson commentedOct 5, 2016
@tpoisot comment on Twitter how verbose the outputs from some
summarymethods are for ordination models. These don't so much as summarise a fit but provide detailed output including lots of axis score data.I copied vegan when writing
summary()methods for my cocorresp pkg and am not changing those because the verbosity of output just isn't useful to anyone.Would anyone freak out too much if I took a look at vegan's
summarymethods for ordination objects and propose changes that would shorten them?