[Vegan-commits] r1386 - in branches/1.17: R inst inst/doc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 1 18:16:24 CET 2010


Author: jarioksa
Date: 2010-12-01 18:16:23 +0100 (Wed, 01 Dec 2010)
New Revision: 1386

Modified:
   branches/1.17/R/biplot.CCorA.R
   branches/1.17/R/deviance.cca.R
   branches/1.17/R/deviance.rda.R
   branches/1.17/R/permutest.cca.R
   branches/1.17/R/print.permutest.cca.R
   branches/1.17/R/rankindex.R
   branches/1.17/inst/ChangeLog
   branches/1.17/inst/doc/FAQ-vegan.texi
   branches/1.17/inst/doc/decision-vegan.Rnw
   branches/1.17/man/anova.cca.Rd
   branches/1.17/man/diversity.Rd
   branches/1.17/man/rankindex.Rd
   branches/1.17/man/vegdist.Rd
Log:
merge r1270:1300 to branches/1.17

Modified: branches/1.17/R/biplot.CCorA.R
===================================================================
--- branches/1.17/R/biplot.CCorA.R	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/R/biplot.CCorA.R	2010-12-01 17:16:23 UTC (rev 1386)
@@ -1,8 +1,11 @@
 `biplot.CCorA` <-
     function(x, plot.type="ov", xlabs, plot.axes = 1:2, int=0.5, col.Y="red", col.X="blue", cex=c(0.7,0.9), ...)
 {
+    ## Function sets par(): reset them on.exit
+    opar <- par(no.readonly = TRUE)
+    on.exit(par(opar))
     #### Internal function
-	larger.frame <- function(mat, percent=0.10)
+    larger.frame <- function(mat, percent=0.10)
 	# Produce an object plot 10% larger than strictly necessary
 	{
 	range.mat <- apply(mat,2,range)
@@ -118,4 +121,4 @@
 		title(main = c("CCorA biplot","Second data table (X)"), line=4)
 		}
 	invisible()
-}
\ No newline at end of file
+}

Modified: branches/1.17/R/deviance.cca.R
===================================================================
--- branches/1.17/R/deviance.cca.R	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/R/deviance.cca.R	2010-12-01 17:16:23 UTC (rev 1386)
@@ -1,2 +1,8 @@
-"deviance.cca" <-
-function(object, ...) object$CA$tot.chi * object$grand.tot
+`deviance.cca` <-
+    function(object, ...)
+{
+    if (is.null(object$CA))
+        0
+    else
+        object$CA$tot.chi * object$grand.tot
+}

Modified: branches/1.17/R/deviance.rda.R
===================================================================
--- branches/1.17/R/deviance.rda.R	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/R/deviance.rda.R	2010-12-01 17:16:23 UTC (rev 1386)
@@ -1,2 +1,8 @@
-"deviance.rda" <-
-function(object, ...) object$CA$tot.chi * (nrow(object$CA$Xbar) - 1)
+`deviance.rda` <-
+    function(object, ...)
+{
+    if (is.null(object$CA))
+        0
+    else
+        object$CA$tot.chi * (nrow(object$CA$Xbar) - 1)
+}

Modified: branches/1.17/R/permutest.cca.R
===================================================================
--- branches/1.17/R/permutest.cca.R	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/R/permutest.cca.R	2010-12-01 17:16:23 UTC (rev 1386)
@@ -5,8 +5,9 @@
     stop("No default permutation test defined")
 
 `permutest.cca` <-
-    function (x, permutations = 100, model = c("reduced", "direct", 
-                                     "full"), first = FALSE, strata, ...) 
+    function (x, permutations = 99,
+              model = c("reduced", "direct", "full"), first = FALSE,
+              strata, ...) 
 {
     model <- match.arg(model)
     isCCA <- !inherits(x, "rda")
@@ -100,9 +101,10 @@
     ## numerical inaccuracy
     F.0 <- round(F.0, 12)
     F.perm <- round(F.perm, 12)
-    sol <- list(call = x$call, model = model, F.0 = F.0, F.perm = F.perm, 
-                chi = c(Chi.z, Chi.xz), num = num, den = den, df = c(q, 
-                                                              r), nperm = permutations, method = x$method, first = first,  Random.seed = seed)
+    sol <- list(call = match.call(), testcall = x$call, model = model,
+                F.0 = F.0, F.perm = F.perm,  chi = c(Chi.z, Chi.xz),
+                num = num, den = den, df = c(q, r), nperm = permutations,
+                method = x$method, first = first,  Random.seed = seed)
     if (!missing(strata)) {
         sol$strata <- deparse(substitute(strata))
         sol$stratum.values <- strata

Modified: branches/1.17/R/print.permutest.cca.R
===================================================================
--- branches/1.17/R/print.permutest.cca.R	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/R/print.permutest.cca.R	2010-12-01 17:16:23 UTC (rev 1386)
@@ -2,14 +2,15 @@
     function (x, ...) 
 {
     cat("\nPermutation test for", x$method, "\n\n")
-    writeLines(strwrap(pasteCall(x$call)))
+    writeLines(strwrap(pasteCall(x$testcall)))
     Pval <- (sum(x$F.perm >= x$F.0) + 1)/(x$nperm + 1)
     cat("Permutation test for ")
     if (x$first)
         cat("first constrained eigenvalue\n")
     else
         cat("all constrained eigenvalues\n")
-    cat("Pseudo-F:\t", x$F.0, "\n")
+    cat("Pseudo-F:\t", x$F.0, "(with", paste(x$df, collapse = ", "),
+        "Degrees of Freedom)\n")
     cat("Significance:\t", format.pval(Pval), 
         "\n")
     cat("Based on", x$nperm, "permutations under", x$model, "model")

Modified: branches/1.17/R/rankindex.R
===================================================================
--- branches/1.17/R/rankindex.R	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/R/rankindex.R	2010-12-01 17:16:23 UTC (rev 1386)
@@ -12,15 +12,39 @@
     }
     veg <- as.matrix(veg)
     res <- numeric(length(indices))
-    names(res) <- indices
-    for (i in indices) {
-        y <- vegdist(veg, i)
-        if (stepacross) {
-            is.na(y) <- no.shared(veg)
-            y <- stepacross(y, trace = FALSE, toolong = -1, ...)
+    ## create names if indices is a list of functions without names
+    if (is.list(indices)) {
+        nam <- names(indices)
+        if (is.null(nam))
+            nam <- paste("dis", 1:length(indices), sep="")
+    } else nam <- indices
+    names(res) <- nam
+    ## indices is a list of functions which return dist objects
+    if (is.list(indices)) {
+        for (i in 1:length(indices)) {
+            ## don't accept similarities
+            if (indices[[i]](matrix(1, 2, 2)) != 0)
+                stop("define dissimilarity and not similarity")
+            y <- indices[[i]](veg)
+            ## check class of output
+            if (!inherits(y, "dist"))
+                stop("function in 'indices' must return a 'dist' object")
+            if (stepacross) {
+                is.na(y) <- no.shared(veg)
+                y <- stepacross(y, trace = FALSE, toolong = -1, ...)
+            }
+            res[i] <- cor(span, y, method = method)
         }
-        res[i] <- cor(span, y, method = method)
+    ## indices is a character vector naming methods in vegdist
+    } else {
+        for (i in indices) {
+            y <- vegdist(veg, i)
+            if (stepacross) {
+                is.na(y) <- no.shared(veg)
+                y <- stepacross(y, trace = FALSE, toolong = -1, ...)
+            }
+            res[i] <- cor(span, y, method = method)
+        }
     }
     res
 }
-

Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/inst/ChangeLog	2010-12-01 17:16:23 UTC (rev 1386)
@@ -4,6 +4,22 @@
 
 Version 1.17-5 (opened November 17, 2010)
 
+	* merged r1273, 1275: permutest.cca 99 permutation & saves its
+	call. 
+
+	* merge r1277: biplot.CCorA resets par.
+
+	* merge r1278:1279: vegdist.Rd update.
+
+	* merge r1280: deviance.cca/rda return 0 in unconstrained
+	models.
+
+	* merge r1288:1290, 1305: rankindex takes a list of indices.
+
+	* merge r1296: example on unbiased Simpson in diversity.Rd.
+
+	* merge r1300, 1369:1371: FAQ and vignette updates.
+
 Version 1.17-4 (released August 20, 2010)
 
 	* merged r1263: mrpp.Rd polish.

Modified: branches/1.17/inst/doc/FAQ-vegan.texi
===================================================================
--- branches/1.17/inst/doc/FAQ-vegan.texi	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/inst/doc/FAQ-vegan.texi	2010-12-01 17:16:23 UTC (rev 1386)
@@ -21,7 +21,7 @@
 Creative Commons, 543 Howard Street, 5th Floor, San Francisco,
 California, 94105, USA.
 
-Copyright @copyright{} 2008 Jari Oksanen
+Copyright @copyright{} 2010 Jari Oksanen
 @end quotation
 @end copying
 
@@ -131,9 +131,6 @@
 non-standard packages needed by some vegan functions are:
 @itemize
 
- at item Package @code{cluster}
-is needed by @code{decostand} if environmental data contain factors
-
 @item Package @code{scatterplot3d}
 is needed by @code{ordiplot3d}
 
@@ -141,9 +138,6 @@
 is needed by @code{ordirgl}
 and @code{rgl.isomap}
 
- at item Package @code{tcltk}
-is needed by @code{orditkplot}
-
 @end itemize
 
 @node What other packages are available for ecologists?, What other documentation is available for vegan?, What R packages vegan depends on?, Introduction
@@ -166,6 +160,8 @@
 with @code{vegandocs} command (documented in the vegan help).  The
 documents included in the vegan package are
 @itemize
+ at item
+Vegan @code{NEWS} (not in the development version: only in CRAN)
 @item 
 Vegan @code{ChangeLog}.
 @item
@@ -192,10 +188,6 @@
 @url{http://cc.oulu.fi/~jarioksa/opetus/metodi/vegantutor.pdf}: vegan
 tutorial.
 
- at item
- at url{http://wiki.r-project.org/rwiki/doku.php?id=packages:cran:vegan,,http://wiki.r-project.org/}:
-entry in R-Wiki.
-
 @end itemize
 
 @node Is there a Graphical User Interface (GUI) for vegan?, How to cite vegan?, What other documentation is available for vegan?, Introduction
@@ -225,45 +217,44 @@
 @url{http://cran.r-project.org,,CRAN}) and devel versions (at 
 @url{http://r-forge.r-project.org/projects/vegan/,,R-Forge}). 
 
-Up to versions 1.8-7 and 1.9-34, vegan version numbers were of type
-x.y-z, where number y is even for stable release versions at
- at url{http://cran.r-project.org,,CRAN} and odd for unstable release
-versions at @url{http://cc.oulu.fi/~jarioksa/softhelp/vegan.html,,my
-personal homepage}. Version 1.8-8 was a backport of bug fixes from
-the 1.10 series.
+Vegan version numbers are of type x.y-z, where number y is odd for
+stable release versions at @url{http://cran.r-project.org,,CRAN} and
+even for unstable release versions at
+ at url{http://r-forge.r-project.org/projects/vegan,,F-Forge}.
 
 @node How to build vegan from sources?, Are there binaries for devel versions?, Version numbering in vegan, Introduction
 @section How to build vegan from sources?
 
 In general, you do not need to build vegan from sources, but binary
 builds of release versions are available through
- at url{http://cran.r-project.org/,,CRAN} for Windows and MacOS X. If
-you use some other operating systems, or want to use unstable devel
-versions, you may have to use source packages.
+ at url{http://cran.r-project.org/,,CRAN} for Windows and MacOS X.  If you
+use some other operating systems, you may have to use source packages.
 Vegan is a standard R package, and can be built like instructed in R
 documentation.  Vegan contains source files in C and @acronym{FORTRAN},
 and you need appropriate compilers (which may need more work in Windows
-and MacOS X). 
+and MacOS X).
 
 @node Are there binaries for devel versions?, How to report a bug in vegan?, How to build vegan from sources?, Introduction
 @section Are there binaries for devel versions?
 
 @url{http://r-forge.r-project.org/projects/vegan/,,R-Forge} runs daily
-tests on the devel package, and if passed, it builds source package and
-Windows binaries. You can install those packages within R with command
- at code{install.packages("vegan",
-repos="http://r-forge.r-project.org/")}. 
+tests on the devel package, and if passed, it builds source package
+together with Windows and MacOS X binaries. You can install those
+packages within R with command 
+ at code{install.packages("vegan", repos="http://r-forge.r-project.org/")}.
+If you use GUI menu entry, you must select or define the R-Forge
+repository. 
 
 @node How to report a bug in vegan?, Is it a bug or a feature?, Are there binaries for devel versions?, Introduction
 @section How to report a bug in vegan?
 
-If you think you have found a bug in vegan, you should report it to me.
-The bug report should be so detailed that I can correct the bug.  To
-correct a bug, I should be able to reproduce the buggy behaviour.
-Preferably, you should send me an example that causes a bug.  If it
-needs a data set that is not available in R, you should send me minimal
-data set as well. You also should paste the output or error message in
-your message.  You also should tell me which version of vegan you used.
+If you think you have found a bug in vegan, you should report it to
+vegan maintainers or developers.  The bug report should be so detailed
+that the bug can be replicated and corrected.  Preferably, you should
+send an example that causes a bug.  If it needs a data set that is not
+available in R, you should send a minimal data set as well. You also
+should paste the output or error message in your message.  You also
+should specify which version of vegan you used.
 
 Bug reports are welcome: they are the only way to make vegan non-buggy.
 
@@ -291,19 +282,17 @@
 
 Vegan is dependent on user contribution.  All feedback is welcome.  If
 you have problem with vegan, it may be as simple as incomplete
-documentation, and I'll do my best to improve the documents.
+documentation, and we'll do our best to improve the documents.
 
 Feature requests also are welcome, but they are not necessarily
 fulfilled.  A new feature will be added if it is easy to do and it looks
-useful to me or in general.  
+useful to me or in general, or if you submit code. 
 
 Contributed code and functions are welcome and more certain to be
 included than mere requests.  However, not all functions will be added,
-but I must judge them to be suitable for vegan.  I also audit the code,
-and  typically I edit the code in vegan style for easier maintenance.
-All included contributions will be credited.  You can easily see that
-many vegan functions were contributed by other people, and they are
-listed as authors in the documentation. 
+but I they must be suitable for vegan.  We also audit the code, and
+typically we edit the code in vegan style for easier maintenance.  All
+included contributions will be credited.  
 
 @node Ordination, Other analysis methods , Introduction, Top
 @chapter Ordination
@@ -313,6 +302,7 @@
 * Can you analyse binary or cover class data?::  
 * Why dissimilarities in vegan differ from other sources?::  
 * Zero dissimilarities in isoMDS::  
+* cca fails with ``data.frame expected'' or ``"site.env" missing''::  
 * Variance explained by ordination axes::  
 * Is it possible to have passive points in ordination?::  
 * Class variables and dummies::  
@@ -329,10 +319,13 @@
 @section I have only numeric and positive data but vegan still complaints
 
 You are wrong! Computers are painfully pedantic, and if they find
-non-numeric ore negative data entries, you really have them. Check your
+non-numeric or negative data entries, you really have them. Check your
 data. Most common reasons for non-numeric data are that row names were
-read as a non-numeric variable instead of being used as row
-names. Another is that you had empty cells in your input data.
+read as a non-numeric variable instead of being used as row names (check
+argument @code{row.names} in reading the data), or that the column names
+were interpted as data (check argument @code{header = TRUE} in reading
+the data). Another common reason is that you had empty cells in your
+input data, and these were interprted as missing values.
 
 @node Can you analyse binary or cover class data?, Why dissimilarities in vegan differ from other sources?, I have only numeric and positive data but vegan still complaints, Ordination
 @section Can you analyse binary or cover class data?
@@ -357,7 +350,7 @@
 Another reason may be that indices indeed are defined differently,
 because people use same names for different indices.
 
- at node Zero dissimilarities in isoMDS, Variance explained by ordination axes, Why dissimilarities in vegan differ from other sources?, Ordination
+ at node Zero dissimilarities in isoMDS, cca fails with ``data.frame expected'' or ``"site.env" missing'', Why dissimilarities in vegan differ from other sources?, Ordination
 @section Zero dissimilarities in isoMDS
 
 You can use argument @code{zerodist = "add"} in @code{metaMDS} or
@@ -370,7 +363,17 @@
 zero dissimilarity, and you have to resort to the kluge (or work
 harder with your data).
 
- at node Variance explained by ordination axes, Is it possible to have passive points in ordination?, Zero dissimilarities in isoMDS, Ordination
+ at node cca fails with ``data.frame expected'' or ``"site.env" missing'', Variance explained by ordination axes, Zero dissimilarities in isoMDS, Ordination
+ at section cca fails with ``data.frame expected'' or ``"site.env" missing''
+
+This is not a vegan error message, but it comes from the @code{cca}
+function in the ade4 package. There is an unfortunate name clash, and if
+you have loaded ade4 after vegan, the ade4 version of @code{cca} will
+mask the vegan version. You can use the vegan version using command
+ at code{vegan:cca()}. If you do not need package ade4, you can detach it
+with command @code{detach(package:ade4)}. 
+
+ at node Variance explained by ordination axes, Is it possible to have passive points in ordination?, cca fails with ``data.frame expected'' or ``"site.env" missing'', Ordination
 @section Variance explained by ordination axes.
 
 In general, vegan does not directly give any statistics on the
@@ -389,11 +392,12 @@
 variation'', but now they explain all species equally, and results
 typically are much more useful for the whole community.  Correspondence
 analysis uses another measure of variation (which is not variance), and
-again it typically explains a ``smaller proportion'' with a better
-result.  Detrended correspondence analysis and nonmetric
-multidimensional scaling even do not try to ``explain'' the variation,
-but use other criteria.  All methods are incommensurable, and it is
-impossible to compare methods using ``explanation of variation''.
+again it typically explains a ``smaller proportion'' than principal
+componentsm but with a better result.  Detrended correspondence analysis
+and nonmetric multidimensional scaling even do not try to ``explain''
+the variation, but use other criteria.  All methods are incommensurable,
+and it is impossible to compare methods using ``explanation of
+variation''.
 
 If you still want to get ``explanation of variation'' (or a deranged
 editor requests that from you), it is possible to get this information
@@ -404,7 +408,7 @@
 of conditional (partialled), constrained (canonical) and residual
 components, but you must calculate the proportions by hand.  Function
 @code{eigenvals} extracts the eigenvalues, and
- at code{eigenvals(summary(ord))} reports the proportions explained in the
+ at code{summary(eigenvals(ord))} reports the proportions explained in the
 result object @code{ord}.  Function @code{RsquareAdj} gives the
 R-squared and adjusted R-squared (if available) for constrained
 components.  Function @code{goodness} gives the same statistics for
@@ -414,11 +418,10 @@
 separate components in redundancy analysis.
 
 @item Detrended correspondence analysis (function @code{decorana}).
-The total amount of variation is unknown and undefined in detrended
-correspondence analysis, and therefore proportions from total also are
-unknown and undefined.  @acronym{DCA} is not a method for
-decomposition of variation, and therefore these proportions would not
-make sense either. 
+The total amount of variation is undefined in detrended correspondence
+analysis, and therefore proportions from total are unknown and
+undefined.  @acronym{DCA} is not a method for decomposition of
+variation, and therefore these proportions would not make sense either.
 
 @item Nonmetric multidimensional scaling. 
 @acronym{NMDS} is a method for nonlinear mapping, and the concept of
@@ -432,18 +435,18 @@
 @node Is it possible to have passive points in ordination?, Class variables and dummies, Variance explained by ordination axes, Ordination
 @section Is it possible to have passive points in ordination?
 
-Vegan does not have a concept of passive points, or a point that
-should only little influence the ordination results. However, you can
-add points to eigenvector methods using @code{predict} functions with
+Vegan does not have a concept of passive points, or a point that should
+only little influence the ordination results. However, you can add
+points to eigenvector methods using @code{predict} functions with
 @code{newdata}.  You can first perform an ordination without some
-species or sites, and then you can find scores for all points
-using your complete data as @code{newdata}.  The @code{predict}
-functions are available for basic eigenvector methods in vegan
-(@code{cca}, @code{rda}, @code{decorana}, for an up-to-date list, use command
- at code{methods("predict")}). You also can simulate the passive points in R by using
-low weights to row and columns (this is the method used in software
-with passive points). For instance, the following command makes row 3
-``passive'': @code{dune[3,] <- 0.001*dune[3,]}.
+species or sites, and then you can find scores for all points using your
+complete data as @code{newdata}.  The @code{predict} functions are
+available for basic eigenvector methods in vegan (@code{cca},
+ at code{rda}, @code{decorana}, for an up-to-date list, use command
+ at code{methods("predict")}). You also can simulate the passive points in
+R by using low weights to row and columns (this is the method used in
+software with passive points). For instance, the following command makes
+row 3 ``passive'': @code{dune[3,] <- 0.001*dune[3,]}.
 
 
 @node Class variables and dummies, I want to use Helmert or sum contrasts, Is it possible to have passive points in ordination?, Ordination
@@ -484,7 +487,7 @@
 
 Vegan function @code{alias} gives the defining equations for aliased
 variables.  If you only want to see the names of aliased variables or
-levels in solution @code{sol}, write @code{sol$CCA$alias}.
+levels in solution @code{sol}, use @code{alias(sol, names.only=TRUE)}.
 
 @node Plotting aliased variables, Constrained permutations in vegan, What are aliased variables and how to see them?, Ordination
 @section Plotting aliased variables
@@ -505,10 +508,9 @@
 
 Vegan has an alternative permutation function @code{permuted.index2}
 which allows restricted permutation designs for time series, line
-transects, spatial grids and blocking factors. Over time, the other
-functions that currently use the older @code{permuted.index} will be
-updated to use @code{permuted.index2}, but at the moment it is still
-experimental.
+transects, spatial grids and blocking factors. However, that function is
+not developed at the moment. Vegan is going to switch to using a
+separate package (permute) for permutations.
 
 @node How to use different plotting symbols in ordination graphics?, How to avoid cluttered ordination graphs?, Constrained permutations in vegan, Ordination
 @section How to use different plotting symbols in ordination graphics?
@@ -531,35 +533,42 @@
 some tricks you can use:
 @itemize
 
- at item Use only points, possibly with different types if you do not need
+ at item 
+Use only points, possibly with different types if you do not need
 to see the labels. You may need to first create an empty plot using
 @code{plot(..., type="n")}, if you are not satisfied with the default
 graph. (Here and below  @code{...} means other arguments you want
 to give to your @code{plot} command.)
 
- at item Use points, and add labels to desired points using @code{identify}
-for ordination graphics, if you do not need to see all labels. 
+ at item 
+Use points and add labels to desired points using interactive
+ at code{identify} command if you do not need to see all labels.
 
- at item Add labels using function @code{ordilabel} which uses
-non-transparent background to the text. The labels still shadow each
-other, but the uppermost labels are readable. Argument @code{priority}
-will help in displaying the most interesting labels. 
+ at item 
+Add labels using function @code{ordilabel} which uses non-transparent
+background to the text. The labels still shadow each other, but the
+uppermost labels are readable. Argument @code{priority} will help in
+displaying the most interesting labels.
 
- at item Use @code{orditorp} function that uses labels only if these can be
+ at item 
+Use @code{orditorp} function that uses labels only if these can be
 added to a graph without overwriting other labels, and points otherwise,
 if you do not need to see all labels. You must first create an empty
 plot using  @code{plot(..., type="n")}, and then add labels or points
 with @code{orditorp}.  
 
- at item Use @code{ordipointlabel} which uses points and text labels to the
+ at item 
+Use @code{ordipointlabel} which uses points and text labels to the
 points, and tries to optimize the location of the text to minimize the
 overlap. 
 
- at item Use interactive @code{orditkplot} function that lets you drag
+ at item 
+Use interactive @code{orditkplot} function that lets you drag
 labels of points to better positions if you need to see all labels. Only
 one set of points can be used. 
 
- at item Most @code{plot} functions allow you to zoom to a part of the
+ at item 
+Most @code{plot} functions allow you to zoom to a part of the
 graph using @code{xlim} and @code{ylim} arguments to reduce clutter in
 congested areas.  
 
@@ -578,9 +587,9 @@
 @section Is there TWINSPAN?
 
 No.  It may be possible to port @acronym{TWINSPAN} to vegan, but it is
-not among my top priorities.  If anybody wants to try porting,  I will
-be happy to help.  @acronym{TWINSPAN} has a very permissive license,
-and it would be completely legal to port the function into R.
+not among the vegan top priorities.  If anybody wants to try porting, I
+will be happy to help.  @acronym{TWINSPAN} has a very permissive
+license, and it would be completely legal to port the function into R.
 
 @node How is deviance calculated?,  , Is there TWINSPAN?, Other analysis methods
 @section How is deviance calculated?

Modified: branches/1.17/inst/doc/decision-vegan.Rnw
===================================================================
--- branches/1.17/inst/doc/decision-vegan.Rnw	2010-12-01 14:15:46 UTC (rev 1385)
+++ branches/1.17/inst/doc/decision-vegan.Rnw	2010-12-01 17:16:23 UTC (rev 1386)
@@ -78,7 +78,7 @@
   outside the fill line or absences within the fill line.}
 \end{SCfigure}
 The function can be implemented in many ways following the general
-principles.  Rodr{\'i}guez-Girond{\'e}s and Santamaria \cite{RodGir06}
+principles.  Rodr{\'i}guez-Giron{\'e}s and Santamaria \cite{RodGir06}
 have seen the original code and reveal more details of calculations,
 and their explanation is the basis of the implementation in
 \texttt{vegan}.  However, there are still some open issues, and
@@ -121,7 +121,7 @@
       y = (1-(1-x)^p)^{1/p}
     \end{equation}
     This is similar to the equation suggested by
-    \citet[eq. 4]{RodGir06}, but omits all terms dependent on the
+    \cite[eq. 4]{RodGir06}, but omits all terms dependent on the
     numbers of species or sites, because I could not understand why
     they were needed. The differences are visible only in small data
     sets. The $y$ and $x$ are the coordinates in the unit square, and
@@ -146,31 +146,31 @@
 
 \subsection{Backtracking}
 
-Gotelli and Entsminger's seminal paper \cite{GotelliEnt01} on filling
+Gotelli's and Entsminger's seminal paper \cite{GotelliEnt01} on filling
 algorithms is somewhat confusing: it explicitly deals with ``knight's
 tour'' which is quite a different problem than the one we face with
 null models.  The chess piece ``knight''\footnote{``Knight'' is
   ``Springer'' in German which is very appropriate as Springer was the
-  publisher of the paper on ``knight's tour''} has a track of history:
+  publisher of the paper on ``knight's tour''} has a history:
 a piece in a certain position could only have entered from some
-candidate squares. The filling of incidence matrix no such a history:
+candidate squares. The filling of incidence matrix has not such a history:
 if we know that the item last added was in certain row and column, we
 have no information to guess which of the filled items was entered
 previously. A consequence of dealing with a different problem is that
-\citet{GotelliEnt01} does not give many hints on implementing a fill
+\cite{GotelliEnt01} does not give many hints on implementing a fill
 algorithm as a community null model.
 
-The backtracking is implemented in two stage: filling and
+The backtracking is implemented in two stages in \textbf{vegan}: filling and
 backtracking.
 \begin{enumerate}
   \item The matrix is filled in the order given by the marginal
     probabilities. In this way the matrix will look similar to the
     final matrix at all stages of filling. Equal filling probabilities
-    were not used since that was ineffective and produced strange fill
+    are not used since that is ineffective and produces strange fill
     patterns: the rows and columns with one or a couple of presences
-    were filled first, and the process was cornered to columns and
-    rows with many presences. As a consequence, the the process tried
-    harder to fill that corner, and the result was a more tightly
+    are filled first, and the process is cornered to columns and
+    rows with many presences. As a consequence, the the process tries
+    harder to fill that corner, and the result is a more tightly
     packed quadratic fill pattern than with other methods.
   \item The filling stage stops when no new points can be added
     without exceeding row or column totals. ``Backtracking'' means
@@ -192,49 +192,50 @@
 
 This chapter discusses the scaling of scores (results) in redundancy
 analysis and principal component analysis performed by function
-\texttt{rda} in the \texttt{vegan} library.  Principal component
-analysis, and hence redundancy analysis, is a variant of singular
-value decomposition (\textsc{svd}).  Functions \texttt{rda} and
-\texttt{prcomp} (library \texttt{mva}) even use \textsc{svd}
-internally in their algorithm.  In \textsc{svd} a centred data matrix
-is decomposed into orthogonal components so that $x_{ij} = \sum_k
-\sigma_k u_{ik} v_{jk}$, where $u_{ik}$ and $v_{jk}$ are orthonormal
-coefficient matrices and $\sigma_k$ are singular values.
-Orthonormality means that sum of squared columns is one and their
-cross-product is zero, or $\sum_i u_{ik}^2 = \sum_j v_{jk}^2 = 1$, and
-$\sum_i u_{ik} u_{il} = \sum_j v_{jk} v_{jl} = 0$ for $k \neq l$. This
-is a decomposition, and the original matrix is found exactly from the
-singular vectors and corresponding singular values, and first two
-singular components give the best rank $=2$ least squares estimate of
-the original matrix.
+\texttt{rda} in the \texttt{vegan} library.  
 
+Principal component analysis, and hence redundancy analysis, is a case
+of singular value decomposition (\textsc{svd}).  Functions
+\texttt{rda} and \texttt{prcomp} even use \textsc{svd} internally in
+their algorithm.
+
+In \textsc{svd} a centred data matrix is decomposed into orthogonal
+components so that $x_{ij} = \sum_k \sigma_k u_{ik} v_{jk}$, where
+$u_{ik}$ and $v_{jk}$ are orthonormal coefficient matrices and
+$\sigma_k$ are singular values.  Orthonormality means that sums of
+squared columns is one and their cross-product is zero, or $\sum_i
+u_{ik}^2 = \sum_j v_{jk}^2 = 1$, and $\sum_i u_{ik} u_{il} = \sum_j
+v_{jk} v_{jl} = 0$ for $k \neq l$. This is a decomposition, and the
+original matrix is found exactly from the singular vectors and
+corresponding singular values, and first two singular components give
+the rank $=2$ least squares estimate of the original matrix.
+
 Principal component analysis is often presented (and performed in
 legacy software) as an eigenanalysis of covariance matrices.  Instead
-of data matrix, we analyse a matrix of covariances and variances
-$\mathbf{S}$.  The result will be orthonormal coefficient matrix
+of a data matrix, we analyse a matrix of covariances and variances
+$\mathbf{S}$.  The result are orthonormal coefficient matrix
 $\mathbf{U}$ and eigenvalues $\mathbf{\Lambda}$.  The coefficients
 $u_{ik}$ ares identical to \textsc{svd} (except for possible sign
 changes), and eigenvalues $\lambda_k$ are related to the corresponding
 singular values by $\lambda_k = \sigma_k^2 /(n-1)$.  With classical
 definitions, the sum of all eigenvalues equals the sum of variances of
 species, or $\sum_k \lambda_k = \sum_j s_j^2$, and it is often said
-that first axes explain a certain maximized proportion of total
-variance in the data.  The other orthonormal matrix $\mathbf{V}$ can
-be found indirectly as well, so that we have the same components in
-both methods.
+that first axes explain a certain proportion of total variance in the
+data.  The orthonormal matrix $\mathbf{V}$ of \textsc{svd} can be
+found indirectly as well, so that we have the same components in both
+methods.
 
-The coefficients $u_{ik}$ and $v_{jk}$ are of the same (unit) length
-for all axes $k$, but singular values $\sigma_k$ or eigenvalues
-$\lambda_k$ give the information of the importance of axes, or the
-`axis lengths.'  Instead of the orthonormal coefficients, or equal
-length axes, it is customary to use eigenvalues to scale at least one
-of the alternative scores to reflect the importance of axes or
-describe the true configuration of points.  Table \ref{tab:scales}
-shows some alternative scalings used in various software.  These
-alternatives apply to principal components analysis in all cases, and
-in redundancy analysis, they apply to species scores and constraints or
-linear combination scores; weighted averaging scores have somewhat
-wider dispersion.
+The coefficients $u_{ik}$ and $v_{jk}$ are scaled similarly for all
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/vegan -r 1386


More information about the Vegan-commits mailing list