[med-svn] [r-cran-vegan] 05/07: Imported Upstream version 2.3-0

Charles Plessy plessy at moszumanska.debian.org
Mon Jun 1 05:26:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

plessy pushed a commit to branch master
in repository r-cran-vegan.

commit c054784ed383046adbaca169f1b42541e2c4fb76
Author: Charles Plessy <plessy at debian.org>
Date:   Mon Jun 1 14:12:05 2015 +0900

    Imported Upstream version 2.3-0
---
 DESCRIPTION                   |   8 +-
 MD5                           | 172 +++++++++++++++++++++---------------------
 NAMESPACE                     |  18 +++--
 R/CCorA.R                     |  16 ++--
 R/MDSrotate.R                 |   2 +-
 R/adipart.default.R           |  18 ++---
 R/adonis.R                    |   2 +
 R/anosim.R                    |   2 +
 R/anova.ccabyterm.R           |   2 +-
 R/betadiver.R                 |   2 +-
 R/bioenv.default.R            |   9 +++
 R/capscale.R                  |  26 +++----
 R/cascadeKM.R                 |   3 -
 R/cca.default.R               |  43 ++++++-----
 R/centroids.cca.R             |  11 ++-
 R/estimateR.default.R         |   2 +-
 R/factorfit.R                 |  24 +++---
 R/fitspecaccum.R              |  13 +++-
 R/goodness.cca.R              |  72 ++++++++++++------
 R/goodness.rda.R              |  63 ----------------
 R/make.commsim.R              |  56 +++++++-------
 R/multipart.default.R         |  38 +++++-----
 R/nesteddisc.R                |   4 +-
 R/nestedtemp.R                |   6 +-
 R/ordiArrowMul.R              |  26 +++++--
 R/ordiArrowTextXY.R           |  54 ++++++++++---
 R/ordiGetData.R               |   2 +-
 R/ordiParseFormula.R          |  23 ++++--
 R/ordiR2step.R                |   3 +
 R/orditkplot.R                |  20 ++++-
 R/pcnm.R                      |  13 +++-
 R/permustats.R                |   2 +-
 R/plot.cca.R                  |   2 +-
 R/plot.meandist.R             |  14 ++--
 R/plot.radfit.frame.R         |   6 +-
 R/plot.specaccum.R            |   4 +-
 R/predict.fitspecaccum.R      |  16 ++++
 R/predict.specaccum.R         |  43 +++++++++--
 R/print.oecosimu.R            |   2 +-
 R/print.specaccum.R           |   2 +
 R/print.varpart.R             |   4 +-
 R/print.varpart234.R          |   2 +-
 R/rankindex.R                 |   2 +-
 R/rarecurve.R                 |   2 +-
 R/rarefy.R                    |   5 ++
 R/rareslope.R                 |  42 +++++++++++
 R/rda.default.R               |   7 +-
 R/read.cep.R                  |  10 +--
 R/scores.cca.R                |   4 +-
 R/scores.ordihull.R           |   2 +-
 R/scores.rda.R                |   4 +-
 R/showvarparts.R              |  89 ++++++++++++++++------
 R/specaccum.R                 |   9 ++-
 R/specslope.R                 |  95 +++++++++++++++++++++++
 R/summary.anosim.R            |   6 +-
 R/summary.bioenv.R            |   2 +-
 R/summary.cca.R               |   4 +-
 R/summary.radfit.frame.R      |   4 +-
 R/varpart.R                   |  18 ++---
 R/vegemite.R                  |  50 ++++++------
 build/vignette.rds            | Bin 290 -> 288 bytes
 inst/NEWS.Rd                  | 109 ++++++++++++++++++++++++++
 inst/doc/FAQ-vegan.pdf        | Bin 147419 -> 148353 bytes
 inst/doc/NEWS.html            | 127 +++++++++++++++++++++++++++++++
 inst/doc/decision-vegan.pdf   | Bin 342270 -> 342516 bytes
 inst/doc/diversity-vegan.pdf  | Bin 365631 -> 365737 bytes
 inst/doc/intro-vegan.pdf      | Bin 234860 -> 235169 bytes
 man/cascadeKM.Rd              |  12 +--
 man/cca.Rd                    |   2 +-
 man/diversity.Rd              |  12 ++-
 man/envfit.Rd                 |  19 ++++-
 man/goodness.cca.Rd           |  46 ++++++-----
 man/oecosimu.Rd               |   4 +-
 man/ordiArrowTextXY.Rd        | 109 ++++++++++++++++++++++++++
 man/ordiarrows.Rd             |   8 +-
 man/orditkplot.Rd             |  41 +++++-----
 man/permustats.Rd             |  20 ++---
 man/procrustes.Rd             |   2 +-
 man/sipoo.Rd                  |   4 +-
 man/specaccum.Rd              |  49 ++++++++----
 man/varpart.Rd                |  49 ++++++++----
 man/vegan-internal.Rd         |  22 +-----
 man/vegan-package.Rd          |  11 +--
 vignettes/FAQ-vegan.pdf       | Bin 147419 -> 148353 bytes
 vignettes/FAQ-vegan.texi      |  35 ++++++---
 vignettes/NEWS.html           | 127 +++++++++++++++++++++++++++++++
 vignettes/decision-vegan.tex  |  18 ++---
 vignettes/diversity-vegan.tex |  82 ++++++++++----------
 vignettes/intro-vegan.tex     |  48 ++++++------
 89 files changed, 1506 insertions(+), 655 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 1d4968c..1500a1c 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 2.2-1
-Date: 2015-01-12
+Version: 2.3-0
+Date: 2015-05-21
 Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, 
    Peter R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, 
    M. Henry H. Stevens, Helene Wagner  
@@ -15,6 +15,6 @@ License: GPL-2
 BugReports: https://github.com/vegandevs/vegan/issues
 URL: http://cran.r-project.org, https://github.com/vegandevs/vegan
 NeedsCompilation: yes
-Packaged: 2015-01-12 11:19:50 UTC; jarioksa
+Packaged: 2015-05-26 13:00:30 UTC; jarioksa
 Repository: CRAN
-Date/Publication: 2015-01-12 14:18:14
+Date/Publication: 2015-05-26 15:48:55
diff --git a/MD5 b/MD5
index f131969..1b8c1cc 100644
--- a/MD5
+++ b/MD5
@@ -1,8 +1,8 @@
-375c32e428aa92db6e2fe820c28e0768 *DESCRIPTION
-11e6529b62c1da1ec84e7af867361ef9 *NAMESPACE
+a736a57bc5431a4a5aa60a003b2d494d *DESCRIPTION
+031d8a7624ea3ab751b40d2f64235025 *NAMESPACE
 4b8531b446af54510e5fb31f841aed2f *R/AIC.radfit.R
-4065e45e7c774b85d8cdf2150affdf18 *R/CCorA.R
-6924fe815d768f3b11c25d5f03250524 *R/MDSrotate.R
+e9814d051bdf49db5606399ac3a4704e *R/CCorA.R
+6d37bd49a8a0048cbb7ff8f49487ba63 *R/MDSrotate.R
 1a95c5873b1546683487e17aae4fe511 *R/MOStest.R
 8b2a65acb851c032affb73e3897e926c *R/RsquareAdj.R
 4ff8f584b8619b4262b0453c178b4e4c *R/SSarrhenius.R
@@ -13,14 +13,14 @@ d80688d78aba3cd9367ffaaaec6ec252 *R/TukeyHSD.betadisper.R
 52870b88f88d3ddab1056e03e5036727 *R/add1.cca.R
 0f953ea124a0d579b79d32974961ec87 *R/ade2vegancca.R
 3fea698281bc0b4c3a5ad26f4d44d0e2 *R/adipart.R
-4ec343c3350530e56f917aaffad7f8bc *R/adipart.default.R
+385380b5137c957be9f03e464100faa4 *R/adipart.default.R
 05387ee9e552fcec123b4b922e837eaa *R/adipart.formula.R
-e681e6c2fc31d29b4120e51517fdfea9 *R/adonis.R
+1699e302c91aec89bb8d439f34eb52c0 *R/adonis.R
 fa709efe7fb59234727895d3bbb77419 *R/alias.cca.R
-602cdb75069e4880a5d8c3b6049a984b *R/anosim.R
+25b2fc4e8494024d7163b0de60ace240 *R/anosim.R
 a4f23289c4a5eab2a3587292b306d497 *R/anova.betadisper.R
 68e6eb427d128f411b19e19bb15f4c6c *R/anova.cca.R
-208e400508ab4e1e26de5f78e993de3a *R/anova.ccabyterm.R
+9ea258cc0b669ee9a3b997541b802ee1 *R/anova.ccabyterm.R
 109e34d3c1a5cde84a6b427f91d0d649 *R/anova.ccalist.R
 97cbe54d0f4f7adee7a20b6c982d1ecf *R/anova.ccanull.R
 7fab08bcc596df60a22c4b04c8507121 *R/anova.prc.R
@@ -37,10 +37,10 @@ a7f01bd69394d5554cf10279a2690080 *R/as.preston.R
 704239604b0ed8420cb22a31b28a01d3 *R/as.ts.permat.R
 fbec6d133dea10372ce082c7035a8ab2 *R/beals.R
 72c63138e0fdd6c5a6e37bb0e24fa95e *R/betadisper.R
-0228981546980ab73c8346a0292fa98d *R/betadiver.R
+e7b33dc3a8b3c35424fe06cb6e2a7a8b *R/betadiver.R
 46ae3f75a0b483fecab589637d72a307 *R/bgdispersal.R
 4603ea944d470a9e284cb6cab6d75529 *R/bioenv.R
-aa7920b32b33a496be06fcd6d3a0d460 *R/bioenv.default.R
+8da08aa374ef829ccd69302d71181dca *R/bioenv.default.R
 abe03a297a6200d9b48b38c6d92333aa *R/bioenv.formula.R
 4dbe9f135fadbba3f6939d64a5bb0e29 *R/biplot.CCorA.R
 a214c5bd1447e18f3b6118f850c1a7c3 *R/biplot.rda.R
@@ -56,12 +56,12 @@ b98443c6f47168edc9fd96e8a30c82e1 *R/cIndexKM.R
 a6df607186ceb18d204494b6a33816d4 *R/calibrate.R
 f093f401495379d30354e6424606190a *R/calibrate.cca.R
 f56b52d53b17c7dc8d8c9accd5a3401a *R/calibrate.ordisurf.R
-73bec4078e99f0afb8cfeab0ed35394c *R/capscale.R
-bbff0e97ac052b1742a0e4ba082bac68 *R/cascadeKM.R
+cfade23914ea7a85bd1edf32617dd497 *R/capscale.R
+52b06d758d53934d0b67b4e7653dc3dd *R/cascadeKM.R
 2e09a82ec52e211afc2ac6e8d4b40898 *R/cca.R
-525437539285ce7484c1a880f6b44995 *R/cca.default.R
+fe3b7320b434d46d2308d880ef26787a *R/cca.default.R
 e01e3acecdb9ac8d9195937e9879d126 *R/cca.formula.R
-6102056b628e02085c3bfe779a67c633 *R/centroids.cca.R
+f5a2789cc50349cb7ee3cec80bda6a1f *R/centroids.cca.R
 c66d8fbe69ccca94f2ee8f777ff16ae2 *R/checkSelect.R
 6faf5d12f3e1abb40c0f8d2cfeabc4b4 *R/clamtest.R
 6ee5070eb4ec1a82e1dd59db5328fa41 *R/coef.cca.R
@@ -91,15 +91,15 @@ abdc99957cd34d0c5f79ca1d9dd68c68 *R/envfit.default.R
 f76323e8a2b239aec6cc9930bcb712b5 *R/estaccumR.R
 81098475867f802dea0565fe426c9fc5 *R/estimateR.R
 cf0a0bf7116ef7a21e090d0c1a76f8d0 *R/estimateR.data.frame.R
-4563aebce4d1808042d81a6a1bf174b7 *R/estimateR.default.R
+1ae8328aa077ec86d41eb74d12270bb2 *R/estimateR.default.R
 1df3194c88598964282c114cb8db5513 *R/estimateR.matrix.R
 8a07a85be771af60a831d8b4ed3c8973 *R/eventstar.R
 5ad3db71edac392b0513ccb96700af0d *R/extractAIC.cca.R
-977df97b8394882fb925172a3c677149 *R/factorfit.R
+4833d9bfab4a5c585484b5d0a5a0ef34 *R/factorfit.R
 7e304b1c384c4d8588e5dbedd9459c73 *R/fieller.MOStest.R
 ee8330855e6a7bc2350047d76b2209a4 *R/fisher.alpha.R
 2776f68ef40e177303c3b73163036969 *R/fisherfit.R
-672a4769b413f4f035de3f2c7d03f0ac *R/fitspecaccum.R
+15075c7f443896f54b5e0befd21c17bf *R/fitspecaccum.R
 55db9d51c5dcefafff9b772b6862e565 *R/fitted.capscale.R
 ee2e3daa463fb46ffce01206f8b44fa5 *R/fitted.cca.R
 0080b65cfd48bac5e53961b8e12682e5 *R/fitted.procrustes.R
@@ -108,9 +108,8 @@ ee2e3daa463fb46ffce01206f8b44fa5 *R/fitted.cca.R
 c716cff48e68d6b1d74eaefde86f4cd8 *R/gdispweight.R
 76b1ffb784bab6671ebaa51c3b4bdb0b *R/getPermuteMatrix.R
 57c9a7ccff6a9c066b2aba3475f2330b *R/goodness.R
-681e6b2273eac6f1724d13ce51ad3cf2 *R/goodness.cca.R
+aa3a75ac055af0ac8cf6347c87b2cf3b *R/goodness.cca.R
 5364f16346047d3b8719ddef653a70bb *R/goodness.metaMDS.R
-4188d434bdb95c56734b5e76319bf55e *R/goodness.rda.R
 8a767726c40223a58d4055759bf41efe *R/head.summary.cca.R
 d17f4f6be45b52e01cd605b09b56a80a *R/hierParseFormula.R
 3d19236ee5dd2f1c678061773895e86f *R/hiersimu.R
@@ -136,7 +135,7 @@ a5d9b7fa31477efc0a1ff76a62988a8e *R/lines.procrustes.R
 9a9366b4e132861f1671e5617930b012 *R/lines.spantree.R
 f92ed9f1da4790e02a3fcfc1c199a539 *R/linestack.R
 1dcc7e0504b5468a3bb2253924901e50 *R/make.cepnames.R
-7e0f2ff685a61a5fdb261024cea5cd8b *R/make.commsim.R
+8a269b68b5abd56f36fdb59a8c142210 *R/make.commsim.R
 e4f3f842eee5e4812bdb47325aaf7396 *R/mantel.R
 fdb2f4786b31866197c80d827584edaf *R/mantel.correlog.R
 963b77f33ee9c5152c358309a94cdddf *R/mantel.partial.R
@@ -152,26 +151,26 @@ f746e66be6ac3ccc3be9cb4b4b375b4d *R/monoMDS.R
 e145ba6b52ae375dc42b40e98e8b6594 *R/mso.R
 7e428f1adfdae287a1d64a79c6f2c3bc *R/msoplot.R
 7c219818ce5841e957db47f16986080b *R/multipart.R
-d97409d999625ad156c0ef177eb79c93 *R/multipart.default.R
+9b638597fb52736dc7c3b1c1e31f8726 *R/multipart.default.R
 4f3e2c82d5783c04f9a50761c82e2f02 *R/multipart.formula.R
 f5e79cb1c2dc1fcabb6e6b5cb4dc0828 *R/nestedbetasor.R
 6100179a10b511a93105c40ac194b088 *R/nestedchecker.R
-788352193f13dda1ab16d031939b3baa *R/nesteddisc.R
+61fd2dd194d36e49f46c56dde858a607 *R/nesteddisc.R
 20cd3b812b25a8012ea80be97b12520a *R/nestedn0.R
 36f7ec0897cd6517784bc7dcb12ce827 *R/nestednodf.R
-830451884d0cd81f2b3f8226b593bb64 *R/nestedtemp.R
+e7ddbbc85fd1a656e4343f5469621124 *R/nestedtemp.R
 74b2723851155de631716fa479f8ea38 *R/no.shared.R
 47973ff187f68836a19d20ea37c60868 *R/nobs.R
 9c89764ae10460148c1dcf9d25e05649 *R/nullmodel.R
 8909039c4fbff936278af7fc0506e406 *R/oecosimu.R
 7b3988a207ecfe1ea574c5857ffcd2a3 *R/orderingKM.R
 e3d108eed97633040fa22c2b384e19e4 *R/ordiArgAbsorber.R
-871e2f900809d12e1b0522b303eb7057 *R/ordiArrowMul.R
-898781983832b0c3fef8319a53f4979e *R/ordiArrowTextXY.R
-da71b576fb9908051a545375e14a80e0 *R/ordiGetData.R
+ffd002ae0ed83062dabb963f02f3c854 *R/ordiArrowMul.R
+1f50c54490f6cbfa7300255219939ccb *R/ordiArrowTextXY.R
+1d06482d11f1e2ebd41a61a07ad97dd1 *R/ordiGetData.R
 99c1ec285e2afe4fb8beccbd507a123e *R/ordiNAexclude.R
-b78b985ccd7179b59e031bce191354da *R/ordiParseFormula.R
-cccb6afc19bd7feaa3cf2e98fdbb79d4 *R/ordiR2step.R
+045e89399470e8c72a875570e1229bf2 *R/ordiParseFormula.R
+e2b5e5a2e5d99460cda76ea3b9d6ee42 *R/ordiR2step.R
 7757339f5b8899cb54f13da274abda66 *R/ordiTerminfo.R
 005172ab8025d892cc93829b6933e95f *R/ordiareatest.R
 e06d56a6e7d47767b9e71a73cbd3a80b *R/ordiarrows.R
@@ -191,16 +190,16 @@ e57a2b904e572829a5fd97f5b6576644 *R/ordiresids.R
 1de439b5ffaf18640e08fadcaf7193ee *R/ordisplom.R
 189eb9be55c6527f693925348b63c87d *R/ordistep.R
 a6108f550b749db7139b143cc9e36c9c *R/ordisurf.R
-3bb58cf44b13c19c240dc7a584d49716 *R/orditkplot.R
+da612e647de9c2a0dd853bec899ea620 *R/orditkplot.R
 bc3671e5b7a30e2849d3b59f65783c97 *R/orditorp.R
 5a99010a09cd4a018b02d397be8cc4ec *R/ordixyplot.R
 9fe401c201c03826754ec5613f6ecd71 *R/panel.ordi.R
 94ff61e031b751b9594400a51decc13b *R/panel.ordi3d.R
 3bab50920d7e58e2bf0b96a6b874cd9d *R/pasteCall.R
-8a81288380543076a5a9fefe5ffc7502 *R/pcnm.R
+baeed5122d5d27cc47b3fc00068895a8 *R/pcnm.R
 b5b164724f3872370bff36ef767f8efb *R/permatfull.R
 eeeaf4245033bd2a4ce822c919e42c6e *R/permatswap.R
-b60a2bc00daa5f58ca92af05c6f663f5 *R/permustats.R
+d52f29bac4af376721b75115da94fa9e *R/permustats.R
 3d6a5ecd5feab93db30c063fd144d422 *R/permuted.index.R
 94bae01fad2ee6f0380de55ffb90918a *R/permutest.betadisper.R
 2838084b8e5c948096ee5774d966bb8d *R/permutest.cca.R
@@ -211,7 +210,7 @@ f7c8d52c791489d956a7fd833913f242 *R/plot.MOStest.R
 58d63201c7f61f455b0394b7a0e1235d *R/plot.betadisper.R
 de416206dba5566d70080bc14e86382e *R/plot.betadiver.R
 9023fd332556779fe9405e0714ec5dae *R/plot.cascadeKM.R
-094453d66164cae09c245185be81dcdd *R/plot.cca.R
+b4f0bef610004ec69d8839db6b1791ce *R/plot.cca.R
 61df47a15577f5ad882d2694bdd73d38 *R/plot.clamtest.R
 dc793c47c821ba2961bf284132997ba3 *R/plot.contribdiv.R
 0ab3b62ac155ede193867f43640dbd34 *R/plot.decorana.R
@@ -220,7 +219,7 @@ dc793c47c821ba2961bf284132997ba3 *R/plot.contribdiv.R
 9a4f1746e6e5b80b48994f404e72eb74 *R/plot.humpfit.R
 ed258eefbe3facce3533a16395217fab *R/plot.isomap.R
 55a0851dbcb231f65f8da29e2b904780 *R/plot.mantel.correlog.R
-45b6355daaa38bdd65f98fca234869ed *R/plot.meandist.R
+75636876eb91eb8098c807a2ea508efb *R/plot.meandist.R
 aeddafb96f777e9905a1c4660ed3cadc *R/plot.metaMDS.R
 2574a84757435e0594f89434a9f4ec82 *R/plot.nestedtemp.R
 df06e0f9bd4bc8a546adf466c6daeca6 *R/plot.ordipointlabel.R
@@ -234,12 +233,12 @@ fdc1beae72f52a43883861a8b56bf289 *R/plot.prc.R
 5159170150e3c6d1ed92b5c3ec984b75 *R/plot.procrustes.R
 02ff38f3fb337a63534356255b8641a9 *R/plot.rad.R
 fc2dc1b63ae6f50067a7a376c736394b *R/plot.radfit.R
-af0dac1922ddd4eac1090ba1dd5b1089 *R/plot.radfit.frame.R
+65a62a587ed99980ae047cd60a65b618 *R/plot.radfit.frame.R
 360dec911e8d4e772f888d89b8e0f6f7 *R/plot.radline.R
 08f6b41506125e27b37a08b3bb730ffb *R/plot.renyi.R
 20893b15e8b9db8b2282fef8c63299fa *R/plot.renyiaccum.R
 7cc22df38f8c928da73cd37c93e596f3 *R/plot.spantree.R
-3951c0261856fbcdaff54d2e82bd8e11 *R/plot.specaccum.R
+d668dd7351acfcbfa686fea4ddb85218 *R/plot.specaccum.R
 abc96c8853871035d494dfa9086d4d6e *R/plot.taxondive.R
 6104fadf391072e78a8f2825ac41ceb2 *R/plot.varpart.R
 00d109fe7fc29440698b9f1a4bbc876f *R/plot.varpart234.R
@@ -256,11 +255,11 @@ e352171f478eb27cf4a875cc3a1693fc *R/points.orditkplot.R
 f9dcd972e5c81ce936c9ec5b296d484c *R/prc.R
 32a52d09ade017e52d96eb56c05904c3 *R/predict.cca.R
 049f41cca1b39bf0a221723855cffcff *R/predict.decorana.R
-e9107f2a97c429ff8e45c62a3671c281 *R/predict.fitspecaccum.R
+ca99e94ed4bc39135b84f61ed64bf9fd *R/predict.fitspecaccum.R
 06cca728e43d29da2528b01dccb26962 *R/predict.humpfit.R
 3eaaaf25580077e7dff217c3f237e37a *R/predict.radline.R
 35a61b21f7ff4d24451aff811add56d7 *R/predict.rda.R
-eb223fbfded71ae4f0b374c1e92c3f2e *R/predict.specaccum.R
+6b10b84b569e5eed32629912b19e9c8b *R/predict.specaccum.R
 4f56d16f5bf8f9af3477c23137a70fb5 *R/pregraphKM.R
 81bb150e264f7da07989c909f4531a45 *R/prepanel.ordi3d.R
 0bb3fa9e3847051a28ceb186023bb952 *R/prestondistr.R
@@ -292,7 +291,7 @@ eed481e994c01ec4d7b443fb8cafad46 *R/print.nesteddisc.R
 0f8e3935f95b67b96e066435743bbee0 *R/print.nestednodf.R
 2f1732fffc2fb487420a910a1d3f5971 *R/print.nestedtemp.R
 6126af3f4fb029f14fc7b503ee2f0627 *R/print.nullmodel.R
-f7a679fb3864e1e2e005d80ec28f4432 *R/print.oecosimu.R
+6bc910829bc129ceb8c357e143af4835 *R/print.oecosimu.R
 39c3d65d6a6b2a68f974e936cc6232ae *R/print.permat.R
 fd6136405300e42e73d4850a338505e3 *R/print.permutest.betadisper.R
 d661319e28299f31403b738235f6e7aa *R/print.permutest.cca.R
@@ -304,7 +303,7 @@ e6b0897025e574a25a533aaabe8f6e5f *R/print.protest.R
 8b1a0e667c16cbd376a88962cb3baf19 *R/print.radfit.frame.R
 a589e795a078e79a758c1c848b728be3 *R/print.radline.R
 d64b127c8d733171d69f09f54c756e7b *R/print.simmat.R
-cdb70efbe870e6e804f34a5ba4b4c9eb *R/print.specaccum.R
+738123a37474bd6cc4b5a142f46527c2 *R/print.specaccum.R
 aacebed613c7a8b259424efc39b4e061 *R/print.summary.bioenv.R
 e5b625997dd416b43f2635501e486712 *R/print.summary.cca.R
 9d57753b97cf0f2e3ea8fb96d99c1fb4 *R/print.summary.clamtest.R
@@ -317,8 +316,8 @@ db1dc929d679ce1641c6a7d319091e2c *R/print.summary.permat.R
 0e4bd2b0b5395b17365888876460fe85 *R/print.summary.procrustes.R
 148aa3651ac7d6a0fcc2b5f3dfb98d9f *R/print.summary.taxondive.R
 0511b5e09f1af985431cac7c1b74a8cf *R/print.taxondive.R
-46680885c99c48e4bc5d84203c40d4b0 *R/print.varpart.R
-c80f3931f05ab3066dfe93b98e737856 *R/print.varpart234.R
+84296d0a0ad35ed90252ef66ce239c19 *R/print.varpart.R
+07989e7126de6949c281631c075282da *R/print.varpart234.R
 0001f633e4db1a1498820b0b0b45deac *R/print.vectorfit.R
 8917f5ef5398c984e0e2675c83e74c5c *R/print.wcmdscale.R
 083d526f54611d40ce749ffe95f169ae *R/procrustes.R
@@ -334,14 +333,15 @@ b129148e6efbbe1c45482c93d66f959b *R/rad.null.R
 86012c39c6dcae195cd987d13e1f8a2a *R/radfit.data.frame.R
 2f6d8082f39540bbe7cf0e0cf3c666c9 *R/radfit.default.R
 36cfb246e391a7434c714fbb2269cdb6 *R/radlattice.R
-a93eaad75c58209ac9e7faaeb0642457 *R/rankindex.R
-eac0f40f1fe7d0b412010316aae8318c *R/rarecurve.R
-6be7a6edec618f464dd7c783eca371f0 *R/rarefy.R
+7608e7f23ebe04e3a7ea6e5fe384c431 *R/rankindex.R
+44ead773a0ceaafae24e92523e48f799 *R/rarecurve.R
+3afd2bf3e85bdc553ef5e24436a4788b *R/rarefy.R
+9c65025c61d4c25ce25234533e7b14c6 *R/rareslope.R
 d9a219ae6f3e6155ae76bc59d3e14d30 *R/raupcrick.R
 8116cefb40383fb571abb9fb82091087 *R/rda.R
-1b73dfa420d8447e403e8e214afd2207 *R/rda.default.R
+22c320cd450c1088dfb0a05e577b9a73 *R/rda.default.R
 90b562e8a94febce8430a344392a2943 *R/rda.formula.R
-f87845cb9a96298b61aadc899f995b3f *R/read.cep.R
+66f9447f8ac8388ac02c39aa1f5db95a *R/read.cep.R
 ef65ea5fb624aef7e34284d932503876 *R/renyi.R
 a36c4cc88624a9e45103f656f9eaa491 *R/renyiaccum.R
 90a897e14094cc1eba66c5f59a5bb79c *R/residuals.cca.R
@@ -350,40 +350,41 @@ a36c4cc88624a9e45103f656f9eaa491 *R/renyiaccum.R
 ed66f1e11f53f7fbdbd8663de2b7f5dd *R/scores.R
 d46cc2163dbc117a978f64d54df7bbd4 *R/scores.betadisper.R
 341ee43f8524dccb5e369513a16923b1 *R/scores.betadiver.R
-66a78103e2797044c3a7d3ba15d43811 *R/scores.cca.R
+ff0869aabee96b7d208a75121a6e01e7 *R/scores.cca.R
 447810692c53fab8cd6907ec920e0852 *R/scores.decorana.R
 d7485aeb982d12832c96f54a47dff2f4 *R/scores.default.R
 6415eb8600a7e516ae6c053832c45357 *R/scores.envfit.R
 1124e9978354cabe44bd1a7e258a4392 *R/scores.lda.R
 f60983f80088428cc3ce955a975fa6b3 *R/scores.metaMDS.R
-d07740764d55fbfe7560ad101ea495a1 *R/scores.ordihull.R
+e4b321e08dfaaf89bd548af364902738 *R/scores.ordihull.R
 f146575a3f60358567dfed56e8cbb2cd *R/scores.ordiplot.R
 512cedf50891372019cae370b240a742 *R/scores.orditkplot.R
 4755a38c8b83b76f123b8e84cf47b700 *R/scores.pcnm.R
-1a806bf5c7f715aaf5f4841cfcaed35d *R/scores.rda.R
+14bb630e0f917d671f6ae9671f3ca5cf *R/scores.rda.R
 42e3e9222d18a33abb561bac1db5bc6f *R/screeplot.cca.R
 71a7f620655b068c3a53561fc16bfd39 *R/screeplot.decorana.R
 3fe910b739d447ba5026f077cb0c670d *R/screeplot.prcomp.R
 66d8c6dfecb51ca1afdf309926c00d08 *R/screeplot.princomp.R
-95f15a952493d1965e59006be7f0b8d1 *R/showvarparts.R
+96e51f8fd78641579487ed079ee51170 *R/showvarparts.R
 f77b038c96449c8ea1964bde35b6792d *R/simper.R
 b35ee7d9cdc86eecefb5dcf478fc8abf *R/simpleRDA2.R
 6670475eff913b3586560d4b2ec65149 *R/simulate.nullmodel.R
 a5e793142ae74276a02e761cfe255f22 *R/simulate.rda.R
 9f235c650efc4217a3cc88996b627e1d *R/spandepth.R
 f4554cf72cc501fad09662c612b1c34c *R/spantree.R
-e566cf94049dea30df9100e2d523daa2 *R/specaccum.R
+03330c53fd06adc913961918f0f55c32 *R/specaccum.R
 3c94a17c2602903234a65cb244053130 *R/specnumber.R
 5c1e01f3022cc628895666a5e3b35074 *R/specpool.R
 77cc19684e9ceb27500ca7f802923328 *R/specpool2vect.R
+d24743b3fb58c8a195608e814eeed02c *R/specslope.R
 2cf0545588fb2bb86185f71c21bda1c5 *R/spenvcor.R
 33d884aae53dcc5fa80d9e9ffae4515e *R/stepacross.R
 bd2d1d998f18e7a9c65d5072932cbef2 *R/str.nullmodel.R
 301ba29a09201611845f7adb2b2d7d81 *R/stressplot.R
 f687d03b090a0962026ca60272ab90d5 *R/stressplot.wcmdscale.R
-a61ce658c68a8b17e094f7b0040e4efe *R/summary.anosim.R
-7145185243348b4a1be616329b87b9ff *R/summary.bioenv.R
-772628c3a5de67f983d6ba15d8274b40 *R/summary.cca.R
+55b28298153f00b4c1f8574b0784eb0c *R/summary.anosim.R
+19ce7c501fff2cacc8ad322fd0500a48 *R/summary.bioenv.R
+3a83c24d81c46f07afdd854a2c0193ef *R/summary.cca.R
 c1f7a5045e57ac95c9ae7f13f2a11743 *R/summary.clamtest.R
 bf8be2e9b02c1a3cd5f3ad0005e8354c *R/summary.decorana.R
 088b8c747d67fa5ad158304a21f32628 *R/summary.dispweight.R
@@ -396,7 +397,7 @@ bf8be2e9b02c1a3cd5f3ad0005e8354c *R/summary.decorana.R
 3ef798c28399894f4bf0ba649360e69e *R/summary.poolaccum.R
 71609e72f80900e7c461440336c98c97 *R/summary.prc.R
 a8c1bf3d3f371f3ee5a3de3c39a4113a *R/summary.procrustes.R
-6674c4a162593066795d89bba5abe409 *R/summary.radfit.frame.R
+1a7820db6bf56e31bcc85d3a91f1a831 *R/summary.radfit.frame.R
 25e8a947666bed660358e359730160d9 *R/summary.specaccum.R
 8f34602692f6a5476bb4a6d7b2a269fe *R/summary.taxondive.R
 7c55757d8187363116d3561d53cbc5ba *R/swan.R
@@ -416,7 +417,7 @@ cf0f2cbf17bbd944d455f71918ab88eb *R/treeheight.R
 26fffea5380da4106dfe1f97681524cd *R/tsallis.R
 0093be881d1f7a8f7aa592bcc7f42a08 *R/tsallisaccum.R
 78a5b5292f78b0fd84b943dceddceb97 *R/update.nullmodel.R
-a0682e3051c01f8f5823b158c018d18f *R/varpart.R
+4a337cc0efb81cf89aa2aeafcf695b54 *R/varpart.R
 8d09b6b6390c2866234763beae855cf3 *R/varpart2.R
 77fef5d5355715c9928edd3b9995d415 *R/varpart3.R
 7f4f5d715a9b3e1a916f72ffbfebcc19 *R/varpart4.R
@@ -427,7 +428,7 @@ a0682e3051c01f8f5823b158c018d18f *R/varpart.R
 5656cc97f30992a5e02dba21b2846485 *R/veganMahatrans.R
 bd27a53ddee749358d854ed5daef715c *R/vegandocs.R
 0f163ee6f1ede80946907518f7cd52ea *R/vegdist.R
-b0194270cdab1ba7f2b190a7077f78c5 *R/vegemite.R
+b1855fd70cd8c70e9b480605297bcc63 *R/vegemite.R
 5d6047d7f63f04ae9ff40179c534aa0b *R/veiledspec.R
 4d0f113e697fb166ba912ac34b40b3dc *R/vif.cca.R
 322254f8bc3b02f7a971058cbdfa9edd *R/wascores.R
@@ -437,7 +438,7 @@ ecfd48e2f4df6bcd683a87203dd80e12 *R/weights.cca.R
 73babeed9df14635d99b1a619a1286e4 *R/weights.rda.R
 4138f57726620d493f218e5e3da0013c *R/wisconsin.R
 17cbf4b5c186fe577cf361f0254df1d6 *R/zzz.R
-28cb7a9da307b57fc09d0281f336bb40 *build/vignette.rds
+5aade318f4f03a71719d64ab1887b212 *build/vignette.rds
 0f283f2be37fdfec65ec6e5b0146889c *data/BCI.rda
 412ea5cf443401fe54f0b14c14c45806 *data/dune.env.rda
 b0a8834b45c79fc017717838d700f0f6 *data/dune.phylodis.rda
@@ -452,19 +453,19 @@ ee3c343418d7cf2e435028adf93205f1 *data/sipoo.rda
 f87df84297865b5faf31e232e97a0f94 *data/varechem.rda
 7136b8666250a538d60c88869390a085 *data/varespec.rda
 1fb35aec7042529e18e4673818fecf7f *inst/ChangeLog
-ef2cd15c9225fd09be13a1fb2e115e24 *inst/NEWS.Rd
+5d6f9f8b9e21a4ea373a65c768e61e77 *inst/NEWS.Rd
 9abfab8b05c34dd283379a7d87500ffb *inst/ONEWS
-144c7ffd9edaf154b9bae0ba9bead321 *inst/doc/FAQ-vegan.pdf
-a14c58230a10efe58ff7b20921b2a844 *inst/doc/NEWS.html
+ba1331631c44717ac0e59a4ffc16a08f *inst/doc/FAQ-vegan.pdf
+58b91b511b3c9ac636939922d56e1fda *inst/doc/NEWS.html
 e3e19be6e4226ef4b943c5dd46c3e161 *inst/doc/decision-vegan.R
 09c81618a5a91cbfc5e8c3d969dc63fd *inst/doc/decision-vegan.Rnw
-6c5a0c5460362dedc23fb14ff003ee94 *inst/doc/decision-vegan.pdf
+644a859cdf89e40e992acb47606dc684 *inst/doc/decision-vegan.pdf
 41fae44349a8a602825bddba8750102d *inst/doc/diversity-vegan.R
 06cfa11a83ca0330979d500549f2415a *inst/doc/diversity-vegan.Rnw
-7b552818d472135e5cc960a25fbefd71 *inst/doc/diversity-vegan.pdf
+f7c38db5a9a23158a1f8191bc4175a8f *inst/doc/diversity-vegan.pdf
 42c6873fda4c73ed0ccdeddef41563b2 *inst/doc/intro-vegan.R
 ddee3279ac0982a3da0bcf9fc10947ac *inst/doc/intro-vegan.Rnw
-7c6f0e044a27edb1dc95dc79b2a26b20 *inst/doc/intro-vegan.pdf
+f2d01c31f13578429ecd29e6fe8d60f8 *inst/doc/intro-vegan.pdf
 a1c35ea488b715441cd2269eb6998945 *inst/doc/partitioning.pdf
 5037564d03aeac297d52c412762ffed8 *man/BCI.Rd
 d4d97e3b71561f61bd9f1f0686a57434 *man/CCorA.Rd
@@ -485,8 +486,8 @@ b04c2fae35dba2d97cb248814d5e2fe9 *man/bgdispersal.Rd
 860b9c7f2325f500c27f3c903831efae *man/bioenv.Rd
 1eab4a6369fa1d203a4a3f41f4ee4c06 *man/biplot.rda.Rd
 88602656153ee95f10335487273e132d *man/capscale.Rd
-d3c1067cb5e4dc6f6b9a1c7d94e70ab5 *man/cascadeKM.Rd
-460a434181bc442836ad7f287289e815 *man/cca.Rd
+644e253ebcab91a5ddce85294dda278d *man/cascadeKM.Rd
+ee2214609df58c9a26b87e66260fa8c6 *man/cca.Rd
 9a2708af1831b9ddce1004971b6f4efc *man/cca.object.Rd
 d808372c406b8d0ede9e26623655ac08 *man/clamtest.Rd
 362992febcb1479b750a995203626e40 *man/commsim.Rd
@@ -498,14 +499,14 @@ c01e0664652fbc8ef4963059bee4e422 *man/deviance.cca.Rd
 f58b474141a1b0fdf438bfe6dd8da0c9 *man/dispindmorisita.Rd
 70c0ef1ef267a37e2677476a43b72265 *man/dispweight.Rd
 f3f742efa7511a4c33108a00b512ebd9 *man/distconnected.Rd
-acd876aeea0d7640320815b9cdc5e898 *man/diversity.Rd
+509705abf758024dafadabce9a2604a8 *man/diversity.Rd
 08b96c1a45c11ffcb7f0da33a888421a *man/dune.Rd
 91fa409075b3bd64706c8ff380b3d01d *man/dune.taxon.Rd
 5f5f8c7df063606ccde6124c5dbe8add *man/eigenvals.Rd
-c38ec974394c7d985645112387d6c48e *man/envfit.Rd
+49dae9ef03e94ffd08e34ed4a92e1c68 *man/envfit.Rd
 d2cf422a3d7702ac6293fcd3ff046afc *man/eventstar.Rd
 5857c2307b1dfd69953a88bd3c384180 *man/fisherfit.Rd
-9594c689994edba07e1712b9ea3b550d *man/goodness.cca.Rd
+4135cbc750171f53a71e727291162bf8 *man/goodness.cca.Rd
 afc00cd6ac8f9b56bffbbb77e369057d *man/goodness.metaMDS.Rd
 81f6bbc59aedfa21953278c285c250bf *man/humpfit.Rd
 c8fea575af3da292987d4f8c4aa831b0 *man/indpower.Rd
@@ -525,8 +526,9 @@ b897a6552d7524c853e91f9d8b972cb6 *man/mrpp.Rd
 0a86c6e08d0b55f9b3dc4b35878d9acb *man/nestedtemp.Rd
 c7f768b6f36aec4bc9d5b4c8f72c1141 *man/nobs.adonis.Rd
 d1b6a742f96e2dd5f422008221b05ae0 *man/nullmodel.Rd
-18d0fe4cbf14475524b7f99c9d7fc753 *man/oecosimu.Rd
-3e6f6e4c473e4ea91c18d34bf487ff0c *man/ordiarrows.Rd
+0d904e6f41dc403fffdbeec02c146a4b *man/oecosimu.Rd
+990fc366c31c3695bd6ed0b1d82bb7fb *man/ordiArrowTextXY.Rd
+ef3799c616e8b99501e05a575c15e6b7 *man/ordiarrows.Rd
 de06b800bfbded5bd5b17775f930a3c8 *man/ordihull.Rd
 8f8a34c5fcfcc1fe9f88ca16e84a1da6 *man/ordilabel.Rd
 994cfc973f88c682b741e48377e1b9b4 *man/ordiplot.Rd
@@ -534,18 +536,18 @@ de06b800bfbded5bd5b17775f930a3c8 *man/ordihull.Rd
 d4d27a34b2e7d9d1b732a0d06cb9d9f4 *man/ordiresids.Rd
 da0b3d8e0681a5ddc2bea83fd1796048 *man/ordistep.Rd
 72b2485b893cc2cfb63ddecb095492f9 *man/ordisurf.Rd
-3887cd29dd4adc986e6cf6618136da95 *man/orditkplot.Rd
+7f66b287db7afcdba2180f3fa430d7b6 *man/orditkplot.Rd
 8785cc44c56d1b24fbcbde8de9e325d5 *man/orditorp.Rd
 d971701b3c6f89b3a6b358a3966a43d2 *man/ordixyplot.Rd
 e8a307f119251e6651dacf18c182f73f *man/pcnm.Rd
 d3fd306546c43339ad7d8fd985a28801 *man/permatfull.Rd
-1abd9ac0457eb66698e2a33e33115adf *man/permustats.Rd
+c9b31c8a90d2b0e282e15e03af5d3ae8 *man/permustats.Rd
 4a2ed8481b1f6805d343e83fda91e0ed *man/permutations.Rd
 10e7cc018db792a9c75f3cad7ca3e999 *man/permutest.betadisper.Rd
 47898b675bb6d36fce6961e6a70d8d57 *man/plot.cca.Rd
 242e814ce0a68af785e499a9dbc5d078 *man/prc.Rd
 37cad2f61855e0cc430943ac98885069 *man/predict.cca.Rd
-ebe62922b07c37fce551cc8c3a6231c1 *man/procrustes.Rd
+f07f175a660698d334d2628927b85380 *man/procrustes.Rd
 01a6ca946df5ad493adfb54003ad8e00 *man/pyrifos.Rd
 f61f64cc1be643149fd02f08a0cd7f9f *man/radfit.Rd
 8b12fb04530537414e03e1a6fbccda7c *man/rankindex.Rd
@@ -557,9 +559,9 @@ eec06fd5cfdddadb56bca849f88b38f0 *man/reorder.hclust.Rd
 8104fd642b527f76e159580e3d317fcf *man/screeplot.cca.Rd
 fa4c03b6622b3cba08b633393560b70a *man/simper.Rd
 621f8a2810727ab3523fc0bd69a56dca *man/simulate.rda.Rd
-b34910fa6ed6c9bfbd90a7f7443a135f *man/sipoo.Rd
+2a9336794ae5a322bf2ce6b71edb3f0c *man/sipoo.Rd
 37121fc0a195e97b3b1287678d175bab *man/spantree.Rd
-c4f5b6bac0a924e4238713584e34da4e *man/specaccum.Rd
+ed1dfc98575b9a1a74590172cf9d7c4f *man/specaccum.Rd
 300a45ac7b4b61992707bb60658fa915 *man/specpool.Rd
 5b9e51c85395f80f8504954e4175f877 *man/stepacross.Rd
 812fedada0ae3582c28f4f91bbcedc09 *man/stressplot.wcmdscale.Rd
@@ -568,11 +570,11 @@ c4f5b6bac0a924e4238713584e34da4e *man/specaccum.Rd
 a4b37297402220dee75997c4f49a729c *man/treedive.Rd
 14cc64af5f8a8c5965563a2b03c408f2 *man/tsallis.Rd
 033dd7d7917185cea81e4d7afcd59df9 *man/varechem.Rd
-e7717c542e5c0372ca2ff71bcc26d8b0 *man/varpart.Rd
+96b97e0ed942769faaea7a8fcd892ace *man/varpart.Rd
 0e0e4db86ab5afa92f6d5a921c5e14ff *man/vegan-defunct.Rd
 76c332552a660a95a4e652c251187da9 *man/vegan-deprecated.Rd
-8e32395af09dfb764c821b9f61416f23 *man/vegan-internal.Rd
-1798f9f9db805ac6e3a71c953eae8364 *man/vegan-package.Rd
+e2fbeb5770bfe7ef225c3a30713aea88 *man/vegan-internal.Rd
+c4e776b207d6157ccce51bce90848953 *man/vegan-package.Rd
 36d1ea9c9bb748b484fd12d07627bf55 *man/vegandocs.Rd
 ad48b24429d673e1af3120d0cf6c3eb3 *man/vegdist.Rd
 a2cc1d837017b4de0b4bec617e29533d *man/vegemite.Rd
@@ -588,15 +590,15 @@ a42c4629717137858295a1eb6f3e89de *src/nestedness.c
 31bdbe9b08340e1662a62cf6e61ade6a *src/pnpoly.c
 b9b647fcf8a3e59e10b9351fae60ec06 *src/stepacross.c
 36ea09c9a6553010e786f0e787185d60 *src/vegdist.c
-144c7ffd9edaf154b9bae0ba9bead321 *vignettes/FAQ-vegan.pdf
-f36ab9880f86e1026f7c76c387b46d7b *vignettes/FAQ-vegan.texi
+ba1331631c44717ac0e59a4ffc16a08f *vignettes/FAQ-vegan.pdf
+091bacdffea4d9e22aedc8b37c7872d7 *vignettes/FAQ-vegan.texi
 45ce50de9edf3aeacd8d11d1483f764c *vignettes/Makefile
-a14c58230a10efe58ff7b20921b2a844 *vignettes/NEWS.html
+58b91b511b3c9ac636939922d56e1fda *vignettes/NEWS.html
 09c81618a5a91cbfc5e8c3d969dc63fd *vignettes/decision-vegan.Rnw
-952d0350cd75c9fb4818d125acdad074 *vignettes/decision-vegan.tex
+f3a6cde88199828c5ebc0efa05a9c384 *vignettes/decision-vegan.tex
 06cfa11a83ca0330979d500549f2415a *vignettes/diversity-vegan.Rnw
-71a3401230e3e0696fdc2565986a98d4 *vignettes/diversity-vegan.tex
+92cf5c2f3015356dec6c0ed9bc69e4e2 *vignettes/diversity-vegan.tex
 ddee3279ac0982a3da0bcf9fc10947ac *vignettes/intro-vegan.Rnw
-85c994d79f03bc728bbffcfd809ac724 *vignettes/intro-vegan.tex
+17309ce03e033dec684706b6b2abada2 *vignettes/intro-vegan.tex
 2004d867a35c1fb405934004d121fa9a *vignettes/vegan.bib
 fd58fa43e5e36d0ddcddd26dac1c7e31 *vignettes/vegan.sty
diff --git a/NAMESPACE b/NAMESPACE
index 55f449b..7340751 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -16,16 +16,16 @@ metaMDSdist, metaMDSiter, metaMDSredist, MDSrotate, metaMDS, monoMDS,
 mrpp, msoplot, mso, multipart, make.commsim, nestedbetajac, nestedbetasor, nestedchecker,
 nesteddisc, nestedn0, nestednodf, nestedtemp, nullmodel, oecosimu,
 ordiareatest,
-ordiR2step, ordiarrows, ordicloud, ordicluster, ordiellipse, ordigrid,
+ordiR2step, ordiarrows, ordiArrowMul, ordiArrowTextXY, ordicloud, ordicluster, ordiellipse, ordigrid,
 ordihull, ordilabel, ordiplot, ordipointlabel, ordiresids,
 ordisegments, ordispider, ordisplom, ordistep, ordisurf,
-orditkplot, orditorp, ordixyplot, 
+orditkplot, orditorp, ordixyplot,
 pcnm, permatfull, permatswap, permustats, permutest,
 poolaccum, postMDS, prc, prestondistr, prestonfit, procrustes,
-protest, radfit, radlattice, rankindex, rarefy, rarecurve, raupcrick,
-rda, renyiaccum, renyi, rrarefy, scores,
-showvarparts, simper, spandepth,
-spantree, specaccum, specnumber, specpool2vect, specpool, spenvcor,
+protest, radfit, radlattice, rankindex, rarefy, rarecurve, rareslope,
+raupcrick, rda, renyiaccum, renyi, rrarefy, scores,
+showvarparts, simper, spandepth, spantree, specaccum, specslope,
+specnumber, specpool2vect, specpool, spenvcor,
 stepacross, stressplot, swan, tabasco, taxa2dist, taxondive, tolerance,
 treedist, treedive, treeheight, tsallisaccum, tsallis, varpart,
 vectorfit, vegandocs, vegdist, vegemite, veiledspec, wascores,
@@ -87,6 +87,7 @@ importFrom(mgcv, gam, s, te, predict.gam, summary.gam)
 S3method(adipart, default)
 S3method(adipart, formula)
 # AIC: stats
+S3method(AIC, fitspecaccum)
 S3method(AIC, radfit)
 S3method(AIC, radfit.frame)
 # RsquareAdj: vegan
@@ -159,6 +160,7 @@ S3method(deviance, cca)
 S3method(deviance, rda)
 S3method(deviance, radfit)
 S3method(deviance, radfit.frame)
+S3method(deviance, fitspecaccum)
 # drop1: stats
 S3method(drop1, cca)
 # eigenvals: vegan
@@ -192,7 +194,6 @@ S3method(fitted, rda)
 S3method(goodness, cca)
 S3method(goodness, metaMDS)
 S3method(goodness, monoMDS)
-S3method(goodness, rda)
 # head: utils
 S3method(head, summary.cca)
 # hiersimu: vegan
@@ -443,6 +444,9 @@ S3method(simulate, capscale)
 S3method(simulate, cca)
 S3method(simulate, rda)
 S3method(simulate, nullmodel)
+# specslope: vegan
+S3method(specslope, specaccum)
+S3method(specslope, fitspecaccum)
 # str: utils
 S3method(str, nullmodel)
 # stressplot: vegan
diff --git a/R/CCorA.R b/R/CCorA.R
index bb6f81c..3cc03d3 100644
--- a/R/CCorA.R
+++ b/R/CCorA.R
@@ -98,7 +98,7 @@
     qq <- temp$m
     rownames(X) <- rownoms
     ## Correction PL, 26dec10
-    if(max(pp,qq) >= (n-1)) 
+    if(max(pp,qq) >= (n-1))
     	stop("Not enough degrees of freedom: max(pp,qq) >= (n-1)")
     ## Covariance matrices, etc. from the PCA scores
     S11 <- cov(Y)
@@ -120,7 +120,7 @@
     if((p == q) & (var(K.svd$d) < epsilon))
     	cat("Warning: [nearly] circular covariance matrix. The solution may be meaningless.",'\n')
     ## K.svd$u %*% diag(K.svd$d) %*% t(K.svd$v)   # To check that K = U D V'
-    axenames <- paste("CanAxis",1:length(K.svd$d),sep="")
+    axenames <- paste("CanAxis",seq_along(K.svd$d),sep="")
     U <- K.svd$u
     V <- K.svd$v
     A <- S11.chol.inv %*% U
@@ -134,7 +134,7 @@
     corr.X.Cx <- cor(X.c, Cx)  # To plot X in biplot in space X
     ## Add row and column names
     rownames(Cy) <- rownames(Cx) <- rownoms
-	colnames(Cy) <- colnames(Cx) <- axenames    
+	colnames(Cy) <- colnames(Cx) <- axenames
     rownames(corr.Y.Cy) <- rownames(corr.Y.Cx) <- Ynoms
     rownames(corr.X.Cy) <- rownames(corr.X.Cx) <- Xnoms
     colnames(corr.Y.Cy) <- colnames(corr.Y.Cx) <- axenames
@@ -163,20 +163,20 @@
                       ncol(permat), n))
 
     if (nperm > 0) {
-        p.perm <- sapply(1:nperm, function(indx, ...) 
+        p.perm <- sapply(seq_len(nperm), function(indx, ...)
                          probPillai(Y[permat[indx,],] , X, n, S11.inv, S22.inv, s,
                                     df1, df2, epsilon, Fval, nperm, ...))
         p.perm <- (sum(p.perm) +1)/(nperm + 1)
     } else {
         p.perm <- NA
     }
-    
+
     out <- list(Pillai=PillaiTrace, Eigenvalues=Eigenvalues, CanCorr=K.svd$d,
-                Mat.ranks=c(RsquareX.Y$m, RsquareY.X$m), 
+                Mat.ranks=c(RsquareX.Y$m, RsquareY.X$m),
                 RDA.Rsquares=c(RsquareY.X$Rsquare, RsquareX.Y$Rsquare),
                 RDA.adj.Rsq=c(Rsquare.adj.Y.X, Rsquare.adj.X.Y),
-                nperm=nperm, p.Pillai=p.Pillai, p.perm=p.perm, Cy=Cy, Cx=Cx, 
-                corr.Y.Cy=corr.Y.Cy, corr.X.Cx=corr.X.Cx, corr.Y.Cx=corr.Y.Cx, 
+                nperm=nperm, p.Pillai=p.Pillai, p.perm=p.perm, Cy=Cy, Cx=Cx,
+                corr.Y.Cy=corr.Y.Cy, corr.X.Cx=corr.X.Cx, corr.Y.Cx=corr.Y.Cx,
                 corr.X.Cy=corr.X.Cy, control = attr(permat, "control"),
                 call = match.call())
     class(out) <- "CCorA"
diff --git a/R/MDSrotate.R b/R/MDSrotate.R
index 09ad88e..53313c5 100644
--- a/R/MDSrotate.R
+++ b/R/MDSrotate.R
@@ -3,7 +3,7 @@
 `MDSrotate` <-
     function(object, vec, na.rm = FALSE, ...) 
 {
-    workswith <- c("metaMDS", "monoMDS")
+    workswith <- c("metaMDS", "monoMDS", "GO")
     if (!inherits(object, workswith))
         stop(gettextf("function works only with the results of: %s",
                       paste(workswith, collapse = ", ")))
diff --git a/R/adipart.default.R b/R/adipart.default.R
index 7109aff..fc96322 100644
--- a/R/adipart.default.R
+++ b/R/adipart.default.R
@@ -32,7 +32,7 @@ function(y, x, index=c("richness", "shannon", "simpson"),
         rval[[i]] <- interaction(rhs[,nCol], rval[[(i-1)]], drop=TRUE)
         nCol <- nCol - 1
     }
-    rval <- as.data.frame(rval[rev(1:length(rval))])
+    rval <- as.data.frame(rval[rev(seq_along(rval))])
     l2 <- sapply(rval, function(z) length(unique(z)))
     if (any(l1 != l2))
         stop("levels are not perfectly nested")
@@ -41,7 +41,7 @@ function(y, x, index=c("richness", "shannon", "simpson"),
     fullgamma <-if (nlevels(rhs[,nlevs]) == 1)
         TRUE else FALSE
     ftmp <- vector("list", nlevs)
-    for (i in 1:nlevs) {
+    for (i in seq_len(nlevs)) {
         ftmp[[i]] <- as.formula(paste("~", tlab[i], "- 1"))
     }
 
@@ -71,16 +71,16 @@ function(y, x, index=c("richness", "shannon", "simpson"),
         ## matrix sum *can* change in oecosimu (but default is constant sumMatr)
         sumMatr <- sum(x)
         if (fullgamma) {
-            tmp <- lapply(1:(nlevs-1), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
+            tmp <- lapply(seq_len(nlevs-1), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
             tmp[[nlevs]] <- matrix(colSums(x), nrow = 1, ncol = ncol(x))
         } else {
-            tmp <- lapply(1:nlevs, function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
+            tmp <- lapply(seq_len(nlevs), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
         }
         ## weights will change in oecosimu thus need to be recalculated
         if (weights == "prop")
-            wt <- lapply(1:nlevs, function(i) apply(tmp[[i]], 1, function(z) sum(z) / sumMatr))
-        else wt <- lapply(1:nlevs, function(i) rep(1 / NROW(tmp[[i]]), NROW(tmp[[i]])))
-        a <- sapply(1:nlevs, function(i) sum(divfun(tmp[[i]]) * wt[[i]]))
+            wt <- lapply(seq_len(nlevs), function(i) apply(tmp[[i]], 1, function(z) sum(z) / sumMatr))
+        else wt <- lapply(seq_len(nlevs), function(i) rep(1 / NROW(tmp[[i]]), NROW(tmp[[i]])))
+        a <- sapply(seq_len(nlevs), function(i) sum(divfun(tmp[[i]]) * wt[[i]]))
         if (relative)
             a <- a / a[length(a)]
         b <- sapply(2:nlevs, function(i) a[i] - a[(i-1)])
@@ -95,8 +95,8 @@ function(y, x, index=c("richness", "shannon", "simpson"),
         sim <- list(statistic = sim,
                     oecosimu = list(z = tmp, pval = tmp, method = NA, statistic = sim))
     }
-    nam <- c(paste("alpha", 1:(nlevs-1), sep="."), "gamma",
-             paste("beta", 1:(nlevs-1), sep="."))
+    nam <- c(paste("alpha", seq_len(nlevs-1), sep="."), "gamma",
+             paste("beta", seq_len(nlevs-1), sep="."))
     names(sim$statistic) <- attr(sim$oecosimu$statistic, "names") <- nam
     call <- match.call()
     call[[1]] <- as.name("adipart")
diff --git a/R/adonis.R b/R/adonis.R
index 87aa426..38c7852 100644
--- a/R/adonis.R
+++ b/R/adonis.R
@@ -25,6 +25,8 @@
     grps <- grps[qrhs$pivot][1:qrhs$rank]
     u.grps <- unique(grps)
     nterms <- length(u.grps) - 1
+    if (nterms < 1)
+        stop("right-hand-side of formula has no usable terms")
     H.s <- lapply(2:length(u.grps),
                   function(j) {Xj <- rhs[, grps %in% u.grps[1:j] ]
                                qrX <- qr(Xj, tol=TOL)
diff --git a/R/anosim.R b/R/anosim.R
index cf1fcd5..c179373 100644
--- a/R/anosim.R
+++ b/R/anosim.R
@@ -14,6 +14,8 @@
         warning("some dissimilarities are negative -- is this intentional?")
     sol <- c(call = match.call())
     grouping <- as.factor(grouping)
+    if (length(levels(grouping)) < 2)
+        stop("there should be more than one class level")
     matched <- function(irow, icol, grouping) {
         grouping[irow] == grouping[icol]
     }
diff --git a/R/anova.ccabyterm.R b/R/anova.ccabyterm.R
index 8b0e509..a11fc09 100644
--- a/R/anova.ccabyterm.R
+++ b/R/anova.ccabyterm.R
@@ -137,7 +137,7 @@
     fla <- reformulate(names(LC))
     Pvals <- rep(NA, length(eig))
     environment(object$terms) <- environment()
-    for (i in 1:length(eig)) {
+    for (i in seq_along(eig)) {
         part <- paste("~ . +Condition(",
                       paste(names(LC)[-i], collapse = "+"), ")")
         upfla <- update(fla, part)
diff --git a/R/betadiver.R b/R/betadiver.R
index a563098..0bc8876 100644
--- a/R/betadiver.R
+++ b/R/betadiver.R
@@ -27,7 +27,7 @@
                  "z"="(log(2)-log(2*a+b+c)+log(a+b+c))/log(2)"
                  )
     if (help) {
-        for (i in 1:length(beta)) 
+        for (i in seq_along(beta)) 
             writeLines(strwrap(paste(i, " \"", names(beta[i]),
                                      "\" = ", beta[[i]], "\n", sep="")))
         return(invisible(NULL))
diff --git a/R/bioenv.default.R b/R/bioenv.default.R
index bc684fe..f7dc3f9 100644
--- a/R/bioenv.default.R
+++ b/R/bioenv.default.R
@@ -29,7 +29,16 @@ function (comm, env, method = "spearman", index = "bray", upto = ncol(env),
         partial <- dist(partial)
     if (!is.null(partial) && !pmatch(method, c("pearson", "spearman"), nomatch=FALSE))
         stop("method ", method, " invalid in partial bioenv")
+    ## remove constant variables
+    constant <- apply(env, 2, function(x) length(unique(x))) <= 1
+    if (any(constant)) {
+        warning("the following variables are constant and were removed: ",
+                paste(colnames(env)[constant], collapse=", "))
+        env <- env[, !constant, drop = FALSE]
+    }
     n <- ncol(env)
+    if (n < 1)
+        stop("no usable variables in 'env'")
     ntake <- 2^n - 1
     ndone <- 0
     upto <- min(upto, n)
diff --git a/R/capscale.R b/R/capscale.R
index 2a1ecdf..445c2e4 100644
--- a/R/capscale.R
+++ b/R/capscale.R
@@ -16,8 +16,8 @@
     ## The following line was eval'ed in environment(formula), but
     ## that made update() fail. Rethink the line if capscale() fails
     ## mysteriously at this point.
-    X <- eval(formula[[2]], envir=parent.frame(),
-              enclos = environment(formula))
+    X <- eval(formula[[2]], envir=environment(formula),
+              enclos = globalenv())
     if (!inherits(X, "dist")) {
         comm <- X
         dfun <- match.fun(dfun)
@@ -45,22 +45,22 @@
     ## evaluate formula: ordiParseFormula will return dissimilarities
     ## as a symmetric square matrix (except that some rows may be
     ## deleted due to missing values)
-    fla <- update(formula, X ~ .)
-    environment(fla) <- environment()
-    d <- ordiParseFormula(fla,
-                          if(is.data.frame(data) && !is.null(comm)) cbind(data, comm)
-                          else data,
-                          envdepth = 1, na.action = na.action,
+    d <- ordiParseFormula(formula,
+                          data,
+                          na.action = na.action,
                           subset = substitute(subset))
     ## ordiParseFormula subsets rows of dissimilarities: do the same
-    ## for columns ('comm' is handled later)
-    if (!is.null(d$subset))
-        d$X <- d$X[, d$subset, drop = FALSE]
+    ## for columns ('comm' is handled later). ordiParseFormula
+    ## returned the original data, but we use instead the potentially
+    ## changed X and discard d$X.
+    if (!is.null(d$subset)) {
+        X <- as.matrix(X)[d$subset, d$subset, drop = FALSE]
+    }
     ## Delete columns if rows were deleted due to missing values
     if (!is.null(d$na.action)) {
-        d$X <- d$X[, -d$na.action, drop = FALSE]
+        X <- as.matrix(X)[-d$na.action, -d$na.action, drop = FALSE]
     }
-    X <- as.dist(d$X)
+    X <- as.dist(X)
     k <- attr(X, "Size") - 1
     if (sqrt.dist)
         X <- sqrt(X)
diff --git a/R/cascadeKM.R b/R/cascadeKM.R
index dc8b439..7f186af 100644
--- a/R/cascadeKM.R
+++ b/R/cascadeKM.R
@@ -47,9 +47,6 @@ function(data, inf.gr, sup.gr, iter = 100, criterion="calinski")
     h <- 1
     for(ii in inf.gr:sup.gr)
     {
-        ## Initialization
-        ## set.seed(ii)  
-        ## Set.seed � �t� enlev� car il rend instable la fonction kmeans
         j <- ii - inf.gr + 1
         tmp <- kmeans(data, ii, iter.max = 50, nstart=iter)
         size[1:ii,h] <- tmp$size
diff --git a/R/cca.default.R b/R/cca.default.R
index 47bcbbb..28deb44 100644
--- a/R/cca.default.R
+++ b/R/cca.default.R
@@ -1,5 +1,5 @@
 `cca.default` <-
-    function (X, Y, Z, ...) 
+    function (X, Y, Z, ...)
 {
     ZERO <- 1e-04
     CCA <- NULL
@@ -12,8 +12,13 @@
         attr(x, "centre") <- w.c
         x
     }
+    ## Protect against grave misuse: some people have used
+    ## dissimilarities instead of data
+    if (inherits(X, "dist") || NCOL(X) == NROW(X) &&
+        isTRUE(all.equal(X, t(X))))
+        stop("function cannot be used with (dis)similarities")
     X <- as.matrix(X)
-    if (any(rowSums(X) <= 0)) 
+    if (any(rowSums(X) <= 0))
         stop("All row sums must be >0 in the community data matrix")
     if (any(tmp <- colSums(X) <= 0)) {
         exclude.spec <- seq(along=tmp)[tmp]
@@ -35,7 +40,7 @@
         Z <- qr.fitted(Q, Xbar)
         tmp <- sum(svd(Z, nu = 0, nv = 0)$d^2)
         if (Q$rank) {
-            pCCA <- list(rank = Q$rank, tot.chi = tmp, QR = Q, 
+            pCCA <- list(rank = Q$rank, tot.chi = tmp, QR = Q,
                          Fit = Z, envcentre = attr(Z.r, "centre"))
             Xbar <- qr.resid(Q, Xbar)
         }
@@ -47,7 +52,7 @@
         Y <- as.matrix(Y)
         Y.r <- weight.centre(Y, rowsum)
         Q <- qr(cbind(Z.r, Y.r), tol = ZERO)
-        if (is.null(pCCA)) 
+        if (is.null(pCCA))
             rank <- Q$rank
         else rank <- Q$rank - pCCA$rank
         ## save rank of constraints
@@ -56,7 +61,7 @@
         sol <- svd(Y)
         ## rank of svd can be < qrank
         rank <- min(rank, sum(sol$d > ZERO))
-        ax.names <- paste("CCA", 1:length(sol$d), sep = "")
+        ax.names <- paste("CCA", seq_along(sol$d), sep = "")
         colnames(sol$u) <- ax.names
         colnames(sol$v) <- ax.names
         names(sol$d) <- ax.names
@@ -64,20 +69,20 @@
         rownames(sol$v) <- colnames(X)
         if (rank) {
             CCA <- list(eig = sol$d[1:rank]^2)
-            CCA$u <- sweep(as.matrix(sol$u[, 1:rank, drop = FALSE]), 
+            CCA$u <- sweep(as.matrix(sol$u[, 1:rank, drop = FALSE]),
                            1, 1/sqrt(rowsum), "*")
-            CCA$v <- sweep(as.matrix(sol$v[, 1:rank, drop = FALSE]), 
+            CCA$v <- sweep(as.matrix(sol$v[, 1:rank, drop = FALSE]),
                            1, 1/sqrt(colsum), "*")
-            wa.eig <- sweep(Xbar %*% sol$v[, 1:rank, drop = FALSE], 
+            wa.eig <- sweep(Xbar %*% sol$v[, 1:rank, drop = FALSE],
                             1, 1/sqrt(rowsum), "*")
             CCA$wa <- sweep(wa.eig, 2, 1/sol$d[1:rank], "*")
             oo <- Q$pivot
-            if (!is.null(pCCA$rank)) 
+            if (!is.null(pCCA$rank))
                 oo <- oo[-(1:pCCA$rank)] - ncol(Z.r)
             oo <- oo[1:qrank]
-            if (length(oo) < ncol(Y.r)) 
+            if (length(oo) < ncol(Y.r))
                 CCA$alias <- colnames(Y.r)[-oo]
-            CCA$biplot <- cor(Y.r[, oo, drop = FALSE], sol$u[, 
+            CCA$biplot <- cor(Y.r[, oo, drop = FALSE], sol$u[,
                                         1:rank, drop = FALSE])
             CCA$rank <- rank
             CCA$qrank <- qrank
@@ -99,11 +104,11 @@
         if (exists("exclude.spec")) {
             attr(CCA$v, "na.action") <- exclude.spec
         }
-        
+
     }
     Q <- qr(Xbar)
     sol <- svd(Xbar)
-    ax.names <- paste("CA", 1:length(sol$d), sep = "")
+    ax.names <- paste("CA", seq_along(sol$d), sep = "")
     colnames(sol$u) <- ax.names
     colnames(sol$v) <- ax.names
     names(sol$d) <- ax.names
@@ -111,15 +116,15 @@
     rownames(sol$v) <- colnames(X)
     rank <- min(Q$rank, sum(sol$d > ZERO))
     if (rank) {
-        CA <- list(eig = sol$d[1:rank]^2)
-        CA$u <- sweep(as.matrix(sol$u[, 1:rank, drop = FALSE]), 
+        CA <- list(eig = sol$d[seq_len(rank)]^2)
+        CA$u <- sweep(as.matrix(sol$u[, seq_len(rank), drop = FALSE]),
                       1, 1/sqrt(rowsum), "*")
-        CA$v <- sweep(as.matrix(sol$v[, 1:rank, drop = FALSE]), 
+        CA$v <- sweep(as.matrix(sol$v[, seq_len(rank), drop = FALSE]),
                       1, 1/sqrt(colsum), "*")
         CA$rank <- rank
         CA$tot.chi <- sum(CA$eig)
         CA$Xbar <- Xbar
-        
+
     } else {   # zero rank: no residual component
         CA <- list(eig = 0, rank = rank, tot.chi = 0,
                    Xbar = Xbar)
@@ -134,8 +139,8 @@
     ## computed pCCA$rank was needed before, but zero it here
     if (!is.null(pCCA) && pCCA$tot.chi == 0)
         pCCA$rank <- 0
-    sol <- list(call = call, grand.total = gran.tot, rowsum = rowsum, 
-                colsum = colsum, tot.chi = tot.chi, pCCA = pCCA, CCA = CCA, 
+    sol <- list(call = call, grand.total = gran.tot, rowsum = rowsum,
+                colsum = colsum, tot.chi = tot.chi, pCCA = pCCA, CCA = CCA,
                 CA = CA)
     sol$method <- "cca"
     sol$inertia <- "mean squared contingency coefficient"
diff --git a/R/centroids.cca.R b/R/centroids.cca.R
index 12deeac..a267b4f 100644
--- a/R/centroids.cca.R
+++ b/R/centroids.cca.R
@@ -17,13 +17,12 @@
     pnam <- labels(tmp)
     out <- NULL
     if (ncol(x) == 1) {
-        for(i in 1:length(tmp)) {
-            names(tmp[[i]]) <- paste(pnam[i], names(tmp[[i]]), sep="")
-            out <- c(out, tmp[[i]])
-            out <- matrix(out, nrow=1, dimnames = list(NULL, names(out)))
-        }  
+        nm <- unlist(sapply(pnam,
+                            function(nm) paste(nm, names(tmp[[nm]]), sep="")),
+                     use.names=FALSE)
+        out <- matrix(unlist(tmp), nrow=1, dimnames = list(NULL, nm))
     } else {
-        for (i in 1:length(tmp)) {
+        for (i in seq_along(tmp)) {
             colnames(tmp[[i]]) <- paste(pnam[i], colnames(tmp[[i]]), 
                                         sep = "")
             out <- cbind(out, tmp[[i]])
diff --git a/R/estimateR.default.R b/R/estimateR.default.R
index c265f92..77fdc46 100644
--- a/R/estimateR.default.R
+++ b/R/estimateR.default.R
@@ -76,7 +76,7 @@
     sd.Chao1 <- sqrt(sd.Chao1)
 
     C.ace <- 1 - a[1]/N.rare
-    i <- 1:length(a)
+    i <- seq_along(a)
     thing <- i * (i - 1) * a
     Gam <- sum(thing) * S.rare/(C.ace * N.rare * (N.rare - 1)) - 
         1
diff --git a/R/factorfit.R b/R/factorfit.R
index f93d3ce..ebf5a0e 100644
--- a/R/factorfit.R
+++ b/R/factorfit.R
@@ -1,5 +1,5 @@
 `factorfit` <-
-    function (X, P, permutations = 0, strata = NULL, w,  ...) 
+    function (X, P, permutations = 0, strata = NULL, w,  ...)
 {
     P <- as.data.frame(P)
     ## Check that all variables are factors, and coerce if necessary
@@ -7,7 +7,7 @@
         P <- data.frame(lapply(P, function(x)
                         if (is.factor(x)) x else factor(x)))
     P <- droplevels(P) ## make sure only the used levels are present
-    if (any(!sapply(P, is.factor))) 
+    if (any(!sapply(P, is.factor)))
         stop("All non-numeric variables must be factors")
     NR <- nrow(X)
     NC <- ncol(X)
@@ -19,7 +19,7 @@
     r <- NULL
     pval <- NULL
     totvar <- .C("goffactor", as.double(X), as.integer(rep(0, NR)),
-                 as.double(w), as.integer(NR), as.integer(NC), as.integer(1), 
+                 as.double(w), as.integer(NR), as.integer(NC), as.integer(1),
                  double(1), double(1), double(1), var = double(1), PACKAGE = "vegan")$var
     sol <- centroids.cca(X, P, w)
     var.id <- rep(names(P), sapply(P, nlevels))
@@ -27,12 +27,12 @@
     permat <- getPermuteMatrix(permutations, NR, strata = strata)
     permutations <- nrow(permat)
 
-    for (i in 1:length(P)) {
+    for (i in seq_along(P)) {
         A <- as.integer(P[[i]])
         NL <- nlevels(P[[i]])
         invar <- .C("goffactor", as.double(X), as.integer(A - 1), as.double(w),
-                    as.integer(NR), as.integer(NC), 
-                    as.integer(NL), double(NL), double(NL), double(NL), 
+                    as.integer(NR), as.integer(NC),
+                    as.integer(NL), double(NL), double(NL), double(NL),
                     var = double(1), PACKAGE = "vegan")$var
         r.this <- 1 - invar/totvar
         r <- c(r, r.this)
@@ -43,24 +43,24 @@
                 take <- A[indx]
                 invar <- .C("goffactor", as.double(X),
                             as.integer(take -  1), as.double(w),
-                            as.integer(NR), as.integer(NC), 
-                            as.integer(NL), double(NL), double(NL), double(NL), 
+                            as.integer(NR), as.integer(NC),
+                            as.integer(NL), double(NL), double(NL), double(NL),
                             var = double(1), PACKAGE = "vegan")$var
                 1 - invar/totvar
             }
-            tmp <- sapply(1:permutations,
+            tmp <- sapply(seq_len(permutations),
                           function(indx,...) ptest(permat[indx,], ...))
             pval.this <- (sum(tmp >= r.this) + 1)/(permutations + 1)
             pval <- c(pval, pval.this)
         }
     }
-    if (is.null(colnames(X))) 
+    if (is.null(colnames(X)))
         colnames(sol) <- paste("Dim", 1:ncol(sol), sep = "")
     else colnames(sol) <- colnames(X)
     names(r) <- names(P)
-    if (!is.null(pval)) 
+    if (!is.null(pval))
         names(pval) <- names(P)
-    out <- list(centroids = sol, r = r, permutations = permutations, 
+    out <- list(centroids = sol, r = r, permutations = permutations,
                 pvals = pval, var.id = var.id)
     out$control <- attr(permat, "control")
     class(out) <- "factorfit"
diff --git a/R/fitspecaccum.R b/R/fitspecaccum.R
index bed0f02..ce23d9d 100644
--- a/R/fitspecaccum.R
+++ b/R/fitspecaccum.R
@@ -16,6 +16,12 @@ fitspecaccum <-
     else
         x <- object$sites
     hasWeights <- !is.null(object$weights)
+    ## scale weights to correspond to the no. of sites
+    if (hasWeights) {
+        w <- as.matrix(object$weights)
+        n <- nrow(w)
+        w <- sweep(w, 2, w[n,], "/") * n
+    }
     NLSFUN <- function(y, x, model, ...) {
         switch(model,
         "arrhenius" = nls(y ~ SSarrhenius(x, k, z),  ...),
@@ -31,11 +37,12 @@ fitspecaccum <-
     mods <- lapply(seq_len(NCOL(SpeciesRichness)),
                   function(i, ...)
                    NLSFUN(SpeciesRichness[,i],
-                          if (hasWeights) object$weights[,i] else x,
+                          if (hasWeights) w[,i] else x,
                           model, ...), ...)
     object$fitted <- drop(sapply(mods, fitted))
     object$residuals <- drop(sapply(mods, residuals))
     object$coefficients <- drop(sapply(mods, coef))
+    object$SSmodel <- model
     object$models <- mods
     object$call <- match.call()
     class(object) <- c("fitspecaccum", class(object))
@@ -51,7 +58,7 @@ fitspecaccum <-
     if (is.null(x$weights))
         fv <- fitted(x)
     else
-        fv <- sapply(x$models, predict, newdata = list(x = x$effort))
+        fv <- sapply(x$models, predict, newdata = list(x = x$sites))
     matplot(x$sites, fv, col = col, lty = lty, pch = NA,
             xlab = xlab, ylab = ylab, type = "l", ...)
     invisible()
@@ -63,7 +70,7 @@ fitspecaccum <-
     if (is.null(x$weights))
         fv <- fitted(x)
     else
-        fv <- sapply(x$models, predict, newdata= list(x = x$effort))
+        fv <- sapply(x$models, predict, newdata= list(x = x$sites))
     matlines(x$sites, fv, col = col, lty = lty, pch = NA, type = "l", ...)
     invisible()
 }
diff --git a/R/goodness.cca.R b/R/goodness.cca.R
index 7a29b85..f19a73a 100644
--- a/R/goodness.cca.R
+++ b/R/goodness.cca.R
@@ -1,57 +1,79 @@
 `goodness.cca` <-
     function (object, display = c("species", "sites"), choices,
               model = c("CCA", "CA"), statistic = c("explained", "distance"),
-              summarize = FALSE, ...) 
+              summarize = FALSE, addprevious = FALSE, ...)
 {
     model <- match.arg(model)
+    display <- match.arg(display)
+    if (inherits(object, "capscale") && display == "species") 
+        stop("display = \"species\" not available for 'capscale'")
+    if (inherits(object, "rda"))
+        NR <- nobs(object) - 1
+    else
+        NR <- 1
     if (is.null(object$CCA)) 
         model <- "CA"
     if (is.null(object[[model]]) || object[[model]]$rank == 0) 
         stop("model ", model, " is not available")
     statistic <- match.arg(statistic)
-    display <- match.arg(display)
-    cs <- if(display == "species") object$colsum else object$rowsum
+    if (inherits(object, "rda"))
+        cs <- 1
+    else {
+        cs <-
+            if (display == "species") object$colsum else object$rowsum
+    }
     lambda2 <- sqrt(object[[model]]$eig)
+    ## collect contributions to the variation and scores
+    ptot <- ctot <- rtot <- 0
     if (display == "species") {
-        if (is.null(object$CCA)) 
-            Xbar <- object$CA$Xbar
-        else Xbar <- object$CCA$Xbar
+        if (!is.null(object$pCCA))
+            ptot <- diag(crossprod(object$pCCA$Fit)) / NR
+        if (!is.null(object$CCA)) {
+            Xbar <- qr.fitted(object$CCA$QR, object$CCA$Xbar)
+            ctot <- diag(crossprod(Xbar)) / NR
+        }
+        if (!is.null(object$CA))
+            rtot <- diag(crossprod(object$CA$Xbar)) / NR
         v <- sweep(object[[model]]$v, 2, lambda2, "*")
-        tot <- diag(crossprod(Xbar))
     }
     else {
-        tot <- diag(crossprod(t(object$CA$Xbar)))
+        if (!is.null(object$pCCA))
+            ptot <- diag(tcrossprod(object$pCCA$Fit)) / NR
         if (!is.null(object$CCA)) {
-            Xbar <- object$CCA$Xbar
-            Xbar <- qr.fitted(object$CCA$QR, Xbar)
-            tot <- tot + diag(crossprod(t(Xbar)))
+            Xbar <- qr.fitted(object$CCA$QR, object$CCA$Xbar)
+            ctot <- diag(tcrossprod(Xbar)) / NR
         }
+        if (!is.null(object$CA))
+            rtot <- diag(tcrossprod(object$CA$Xbar)) / NR
         v <- sweep(object[[model]]$u, 2, lambda2, "*")
     }
+    v <- sweep(v, 1, sqrt(cs), "*")
+    if (ncol(v) > 1)
+        vexp <- t(apply(v^2, 1, cumsum))
+    else
+        vexp <- v^2
     if (!missing(choices)) 
-        v <- v[, choices, drop = FALSE]
-    vexp <- t(apply(v^2, 1, cumsum))
+        vexp <- vexp[, choices, drop = FALSE]
     if (statistic == "explained") {
-        vexp <- sweep(vexp, 1, cs, "*")
-        if (!is.null(object$pCCA)) {
-            Xbar <- object$pCCA$Fit
-            if (display == "sites") 
-                Xbar <- t(Xbar)
-            ptot <- diag(crossprod(Xbar))
-            tot <- tot + ptot
-            vexp <- sweep(vexp, 1, ptot, "+")
+        tot <- ptot + ctot + rtot
+        if (addprevious) {
+            if (!is.null(object$pCCA))
+                vexp <- sweep(vexp, 1, ptot, "+")
+            if (model == "CA" && !is.null(object$CCA))
+                vexp <- sweep(vexp, 1, ctot, "+")
         }
         vexp <- sweep(vexp, 1, tot, "/")
     }
     else {
-        if (display == "sites" && (!is.null(object$CCA) || !is.null(object$pCCA)))
-            stop("statistic 'distance' not available for sites in constrained analysis")
-        vexp <- sweep(-(vexp), 1, tot/cs, "+")
+        tot <- rtot
+        if (model == "CCA")
+            tot <- tot + ctot
+        vexp <- sweep(-(vexp), 1, tot, "+")
         vexp[vexp < 0] <- 0
         vexp <- sqrt(vexp)
+        vexp <- sweep(vexp, 1, sqrt(cs), "/")
     }
     if (summarize) 
         vexp <- vexp[, ncol(vexp)]
     vexp
 }
-
diff --git a/R/goodness.rda.R b/R/goodness.rda.R
deleted file mode 100644
index ed635d3..0000000
--- a/R/goodness.rda.R
+++ /dev/null
@@ -1,63 +0,0 @@
-`goodness.rda` <-
-    function (object, display = c("species", "sites"), choices,
-              model = c("CCA", "CA"), statistic = c("explained", "distance"),
-              summarize = FALSE, ...) 
-{
-    model <- match.arg(model)
-    display <- match.arg(display)
-    if (inherits(object, "capscale") && display == "species") 
-        stop("display = \"species\" not available for 'capscale'")
-    if (is.null(object$CCA)) 
-        model <- "CA"
-    if (is.null(object[[model]]) || object[[model]]$rank == 0) 
-        stop("model ", model, " is not available")
-    statistic <- match.arg(statistic)
-    cs <- weights(object, display = display)
-    lambda2 <- sqrt(object[[model]]$eig)
-    if (display == "species") {
-        if (is.null(object$CCA)) 
-            Xbar <- object$CA$Xbar
-        else Xbar <- object$CCA$Xbar
-        v <- sweep(object[[model]]$v, 2, lambda2, "*")
-        tot <- diag(crossprod(Xbar)/(nrow(Xbar) - 1))
-    }
-    else {
-        Xbar <- object$CA$Xbar
-        tot <- diag(crossprod(t(Xbar)))
-        if (!is.null(tot)) 
-            tot <- tot/(nrow(Xbar) - 1)
-        if (!is.null(object$CCA)) {
-            Xbar <- object$CCA$Xbar
-            Xbar <- qr.fitted(object$CCA$QR, Xbar)
-            tot <- tot + diag(crossprod(t(Xbar)))/(nrow(Xbar) - 
-                                                   1)
-        }
-        v <- sweep(object[[model]]$u, 2, lambda2, "*")
-    }
-    if (!missing(choices)) 
-        v <- v[, choices, drop = FALSE]
-    vexp <- t(apply(v^2, 1, cumsum))
-    vexp <- sweep(vexp, 1, cs, "*")
-    if (statistic == "explained") {
-        if (!is.null(object$pCCA)) {
-            Xbar <- object$pCCA$Fit
-            if (display == "sites") 
-                Xbar <- t(Xbar)
-            ptot <- diag(crossprod(Xbar))
-            tot <- tot + ptot
-            vexp <- sweep(vexp, 1, ptot, "+")
-        }
-        vexp <- sweep(vexp, 1, tot, "/")
-    }
-    else {
-        if (display == "sites" && (!is.null(object$CCA) || !is.null(object$pCCA)))
-            stop("statistic 'distance' not available for sites in constrained analysis")
-        vexp <- sweep(-(vexp), 1, tot, "+")
-        vexp[vexp < 0] <- 0
-        vexp <- sweep(sqrt(vexp), 1, cs, "/")
-    }
-    if (summarize) 
-        vexp <- vexp[, ncol(vexp)]
-    vexp
-}
-
diff --git a/R/make.commsim.R b/R/make.commsim.R
index 814576d..c4a3bf6 100644
--- a/R/make.commsim.R
+++ b/R/make.commsim.R
@@ -4,9 +4,9 @@
 ## so it can be used instead of match.arg(method) in other functions
 ## NOTE: very very long -- but it can be a central repository of algos
 ## NOTE 2: storage mode coercions are avoided here
-## (with no apparent effect on speed), it should be 
+## (with no apparent effect on speed), it should be
 ## handled by nullmodel and commsim characteristics
-make.commsim <- 
+make.commsim <-
 function(method)
 {
     algos <- list(
@@ -78,19 +78,19 @@ function(method)
             out <- array(unlist(r2dtable(n, rs, cs)), c(nr, nc, n))
             storage.mode(out) <- "integer"
             for (k in seq_len(n))
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = out[,,k], nr, nc, PACKAGE = "vegan")$m
             out
         }),
-        "swap" = commsim(method="swap", binary=TRUE, isSeq=TRUE, 
+        "swap" = commsim(method="swap", binary=TRUE, isSeq=TRUE,
         mode="integer",
         fun=function(x, n, nr, nc, rs, cs, rf, cf, s, fill, thin) {
             out <- array(0L, c(nr, nc, n))
-            out[,,1] <- .C("swap", 
+            out[,,1] <- .C("swap",
                 m = x, nr, nc, thin, PACKAGE = "vegan")$m
             for (k in seq_len(n-1))
-                out[,,k+1] <- .C("swap", 
-                    m = out[,,k], nr, nc, thin, 
+                out[,,k+1] <- .C("swap",
+                    m = out[,,k], nr, nc, thin,
                     PACKAGE = "vegan")$m
             out
         }),
@@ -98,10 +98,10 @@ function(method)
         mode="integer",
         fun=function(x, n, nr, nc, rs, cs, rf, cf, s, fill, thin) {
             out <- array(0L, c(nr, nc, n))
-            out[,,1] <- .C("trialswap", 
+            out[,,1] <- .C("trialswap",
                 m = x, nr, nc, thin, PACKAGE = "vegan")$m
             for (k in seq_len(n-1))
-                out[,,k+1] <- .C("trialswap", 
+                out[,,k+1] <- .C("trialswap",
                     m = out[,,k], nr, nc, thin, PACKAGE = "vegan")$m
             out
         }),
@@ -118,7 +118,7 @@ function(method)
                 ij <- sample(free, prob = prob)
                 i <- (ij - 1)%%nr + 1
                 j <- (ij - 1)%/%nr + 1
-                for (k in 1:length(ij)) {
+                for (k in seq_along(ij)) {
                     if (icount[i[k]] < rs[i[k]] && jcount[j[k]] < cs[j[k]]) {
                         out[ij[k]] <- 1L
                         icount[i[k]] <- icount[i[k]] + 1L
@@ -126,25 +126,25 @@ function(method)
                     }
                 }
                 ndrop <- 1
-                for (i in 1:10000) {
+                for (i in seq_len(10000)) {
                     oldout <- out
                     oldn <- sum(out)
                     drop <- sample(all[out == 1L], ndrop)
                     out[drop] <- 0L
                     candi <- outer(rowSums(out) < rs, colSums(out) < cs, "&") & out == 0L
                     while (sum(candi) > 0) {
-                        if (sum(candi) > 1) 
+                        if (sum(candi) > 1)
                           ij <- sample(all[candi], 1)
                         else ij <- all[candi]
                         out[ij] <- 1L
                         candi <- outer(rowSums(out) < rs, colSums(out) < cs, "&") & out == 0
                     }
-                    if (sum(out) >= fill) 
+                    if (sum(out) >= fill)
                         break
-                    if (oldn >= sum(out)) 
+                    if (oldn >= sum(out))
                         ndrop <- min(ndrop + 1, 4)
                     else ndrop <- 1
-                    if (oldn > sum(out)) 
+                    if (oldn > sum(out))
                         out <- oldout
                 }
                 out
@@ -165,10 +165,10 @@ function(method)
         mode="integer",
         fun=function(x, n, nr, nc, cs, rs, rf, cf, s, fill, thin) {
             out <- array(0L, c(nr, nc, n))
-            out[,,1] <- .C("swapcount", 
+            out[,,1] <- .C("swapcount",
                 m = x, nr, nc, thin, PACKAGE = "vegan")$m
             for (k in seq_len(n-1))
-                out[,,k+1] <- .C("swapcount", 
+                out[,,k+1] <- .C("swapcount",
                     m = out[,,k], nr, nc, thin, PACKAGE = "vegan")$m
             out
         }),
@@ -178,7 +178,7 @@ function(method)
             out <- array(unlist(r2dtable(n, rs, cs)), c(nr, nc, n))
             storage.mode(out) <- "integer"
             for (k in seq_len(n))
-                out[,,k] <- .C("rswapcount", 
+                out[,,k] <- .C("rswapcount",
                     m = out[,,k], nr, nc, fill, PACKAGE = "vegan")$m
             out
         }),
@@ -189,7 +189,7 @@ function(method)
             out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
             storage.mode(out) <- "double"
             for (k in seq_len(n)) {
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = as.integer(out[,,k]), nr, nc, PACKAGE = "vegan")$m
                 out[,,k][out[,,k] > 0] <- sample(nz) # we assume that length(nz)>1
             }
@@ -205,7 +205,7 @@ function(method)
             out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
             storage.mode(out) <- "integer"
             for (k in seq_len(n)) {
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = out[,,k], nr, nc, PACKAGE = "vegan")$m
                 out[,,k][out[,,k] > 0] <- indshuffle(nz - 1L) + 1L  # we assume that length(nz)>1
             }
@@ -218,7 +218,7 @@ function(method)
             storage.mode(out) <- "double"
             I <- seq_len(nr)
             for (k in seq_len(n)) {
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = as.integer(out[,,k]), nr, nc, PACKAGE = "vegan")$m
                 for (i in I) {
                     nz <- x[i,][x[i,] > 0]
@@ -237,7 +237,7 @@ function(method)
             storage.mode(out) <- "double"
             J <- seq_len(nc)
             for (k in seq_len(n)) {
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = as.integer(out[,,k]), nr, nc, PACKAGE = "vegan")$m
                 for (j in J) {
                     nz <- x[,j][x[,j] > 0]
@@ -259,7 +259,7 @@ function(method)
             out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
             storage.mode(out) <- "integer"
             for (k in seq_len(n)) {
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = out[,,k], nr, nc, PACKAGE = "vegan")$m
                 for (i in I) {
                     nz <- as.integer(x[i,][x[i,] > 0])
@@ -281,7 +281,7 @@ function(method)
             out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
             storage.mode(out) <- "integer"
             for (k in seq_len(n)) {
-                out[,,k] <- .C("quasiswap", 
+                out[,,k] <- .C("quasiswap",
                     m = out[,,k], nr, nc,  PACKAGE = "vegan")$m
                 for (j in J) {
                     nz <- as.integer(x[,j][x[,j] > 0])
@@ -297,10 +297,10 @@ function(method)
         mode="double",
         fun=function(x, n, nr, nc, cs, rs, rf, cf, s, fill, thin) {
             out <- array(0, c(nr, nc, n))
-            out[,,1] <- .C("abuswap", 
+            out[,,1] <- .C("abuswap",
                 m = x, nr, nc, thin, 1L, PACKAGE = "vegan")$m
             for (k in seq_len(n-1))
-                out[,,k+1] <- .C("abuswap", 
+                out[,,k+1] <- .C("abuswap",
                     m = out[,,k], nr, nc, thin, 1L, PACKAGE = "vegan")$m
             out
         }),
@@ -308,10 +308,10 @@ function(method)
         mode="double",
         fun=function(x, n, nr, nc, cs, rs, rf, cf, s, fill, thin) {
             out <- array(0, c(nr, nc, n))
-            out[,,1] <- .C("abuswap", 
+            out[,,1] <- .C("abuswap",
                 m = x, nr, nc, thin, 0L, PACKAGE = "vegan")$m
             for (k in seq_len(n-1))
-                out[,,k+1] <- .C("abuswap", 
+                out[,,k+1] <- .C("abuswap",
                     m = out[,,k], nr, nc, thin, 0L, PACKAGE = "vegan")$m
             out
         }),
diff --git a/R/multipart.default.R b/R/multipart.default.R
index abf83e5..90702de 100644
--- a/R/multipart.default.R
+++ b/R/multipart.default.R
@@ -7,7 +7,7 @@
     ## evaluate formula
     lhs <- as.matrix(y)
     if (missing(x))
-        x <- cbind(level_1=seq_len(nrow(lhs)), 
+        x <- cbind(level_1=seq_len(nrow(lhs)),
             leve_2=rep(1, nrow(lhs)))
     rhs <- data.frame(x)
     rhs[] <- lapply(rhs, as.factor)
@@ -20,7 +20,7 @@
     if (any(lhs < 0))
         stop("data matrix contains negative entries")
     if (is.null(colnames(rhs)))
-        colnames(rhs) <- paste("level", 1:nlevs, sep="_")
+        colnames(rhs) <- paste("level", seq_len(nlevs), sep="_")
     tlab <- colnames(rhs)
 
      ## check proper design of the model frame
@@ -34,7 +34,7 @@
         rval[[i]] <- interaction(rhs[,nCol], rval[[(i-1)]], drop=TRUE)
         nCol <- nCol - 1
     }
-    rval <- as.data.frame(rval[rev(1:length(rval))])
+    rval <- as.data.frame(rval[rev(seq_along(rval))])
     l2 <- sapply(rval, function(z) length(unique(z)))
     if (any(l1 != l2))
         stop("levels are not perfectly nested")
@@ -45,7 +45,7 @@
 #    if (!fullgamma && !global)
 #        warning("gamma diversity value might be meaningless")
     ftmp <- vector("list", nlevs)
-    for (i in 1:nlevs) {
+    for (i in seq_len(nlevs)) {
         ftmp[[i]] <- as.formula(paste("~", tlab[i], "- 1"))
     }
 
@@ -77,37 +77,39 @@
     if (global) {
         wdivfun <- function(x) {
             if (fullgamma) {
-                tmp <- lapply(1:(nlevs-1), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
+                tmp <- lapply(seq_len(nlevs - 1),
+                              function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
                 tmp[[nlevs]] <- matrix(colSums(x), nrow = 1, ncol = ncol(x))
             } else {
-                tmp <- lapply(1:nlevs, function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
+                tmp <- lapply(seq_len(nlevs),
+                              function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
             }
-            raw <- sapply(1:nlevs, function(i) divfun(tmp[[i]]))
+            raw <- sapply(seq_len(nlevs), function(i) divfun(tmp[[i]]))
             a <- sapply(raw, mean)
             G <- a[nlevs]
-            b <- sapply(1:(nlevs-1), function(i) G / a[i])
+            b <- sapply(seq_len(nlevs - 1), function(i) G / a[i])
             if (relative)
-                b <- b / sapply(raw[1:(nlevs-1)], length)
+                b <- b / sapply(raw[seq_len(nlevs - 1)], length)
             c(a, b)
         }
     } else {
         wdivfun <- function(x) {
             if (fullgamma) {
-                tmp <- lapply(1:(nlevs-1), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
+                tmp <- lapply(seq_len(nlevs-1), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
                 tmp[[nlevs]] <- matrix(colSums(x), nrow = 1, ncol = ncol(x))
             } else {
-                tmp <- lapply(1:nlevs, function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
+                tmp <- lapply(seq_len(nlevs), function(i) t(model.matrix(ftmp[[i]], rhs)) %*% x)
             }
-            a <- sapply(1:nlevs, function(i) divfun(tmp[[i]]))
-            am <- lapply(1:(nlevs-1), function(i) {
-                    sapply(1:length(unique(id[[i]])), function(ii) {
+            a <- sapply(seq_len(nlevs), function(i) divfun(tmp[[i]]))
+            am <- lapply(seq_len(nlevs - 1), function(i) {
+                    sapply(seq_along(unique(id[[i]])), function(ii) {
                         mean(a[[i]][id[[i]]==ii])
                     })
                 })
-            b <- lapply(1:(nlevs-1), function(i) a[[(i+1)]] / am[[i]])
+            b <- lapply(seq_len(nlevs - 1), function(i) a[[(i+1)]] / am[[i]])
             bmax <- lapply(id, function(i) table(i))
             if (relative)
-                b <- lapply(1:(nlevs-1), function(i) b[[i]] / bmax[[i]])
+                b <- lapply(seq_len(nlevs - 1), function(i) b[[i]] / bmax[[i]])
             c(sapply(a, mean), sapply(b, mean))
         }
     }
@@ -120,8 +122,8 @@
             sim <- list(statistic = sim,
                 oecosimu = list(z = tmp, pval = tmp, method = NA, statistic = sim))
         }
-    nam <- c(paste("alpha", 1:(nlevs-1), sep="."), "gamma",
-        paste("beta", 1:(nlevs-1), sep="."))
+    nam <- c(paste("alpha", seq_len(nlevs - 1), sep="."), "gamma",
+        paste("beta", seq_len(nlevs - 1), sep="."))
     names(sim$statistic) <- attr(sim$oecosimu$statistic, "names") <- nam
     call <- match.call()
     call[[1]] <- as.name("multipart")
diff --git a/R/nesteddisc.R b/R/nesteddisc.R
index 64af484..c31dbca 100644
--- a/R/nesteddisc.R
+++ b/R/nesteddisc.R
@@ -26,11 +26,11 @@
     ## Range of row sums: only swaps between these have an effect
     rs <- range(rowSums(comm))
     ## Function to evaluate discrepancy
-    FUN <- function(x) sum(comm[col(comm)[,x] <= rowSums(comm)] == 0) 
+    FUN <- function(x) sum(comm[col(comm)[,x] <= rowSums(comm)] == 0)
     Ad <- FUN(x)
     ## Go through all le-items and permute ties. Functions allPerms
     ## and shuffleSet are in permute package.
-    for (i in 1:length(le)) {
+    for (i in seq_along(le)) {
         if (le[i] > 1) {
             take <- x
             idx <- (1:le[i]) + cle[i]
diff --git a/R/nestedtemp.R b/R/nestedtemp.R
index b356079..f4f56f4 100644
--- a/R/nestedtemp.R
+++ b/R/nestedtemp.R
@@ -31,7 +31,7 @@
         i <- rowpack(comm, j)
     }
     ## Improve eight times
-    for (k in 1:8) {
+    for (k in seq_len(8)) {
         j <- colpack(comm, i)
         i <- rowpack(comm, j)
     }
@@ -67,8 +67,8 @@
     p <- sol$root
     ## row coordinates of the fill line for all matrix entries
     out <- matrix(0, nrow=length(r), ncol=length(c))
-    for (i in 1:length(r))
-        for (j in 1:length(c)) {
+    for (i in seq_along(r))
+        for (j in seq_along(c)) {
             a <- c[j] - r[i]
             out[i,j] <- uniroot(function(x, ...) fillfun(x, p) - a -x,
                                 c(0,1), p = p)$root
diff --git a/R/ordiArrowMul.R b/R/ordiArrowMul.R
index af9abcb..23759b2 100644
--- a/R/ordiArrowMul.R
+++ b/R/ordiArrowMul.R
@@ -1,19 +1,33 @@
 ### Scaling of arrows to 'fill' a plot with vectors centred at 'at'.
 ### Plot dims from 'par("usr")' and arrow heads are in 'x'.
-`ordiArrowMul` <-
-    function (x, at = c(0,0), fill=0.75) 
-{
+`ordiArrowMul` <- function (x, at = c(0,0), fill = 0.75,
+                            display, choices = c(1,2), ...) {
+    ## handle x, which we try with scores, but also retain past usage of
+    ## a two column matrix
+    X <- if (is.matrix(x)) {
+        nc <- NCOL(x)
+        if (nc != 2L) {
+            stop("A 2-column matrix of coordinates is required & not supplied.")
+        }
+        x
+    } else {
+        if (inherits(x, "envfit")) {
+            scores(x, display = "vectors", ...)[, 1:2]
+        } else {
+            scores(x, display = display, choices = choices, ...)
+        }
+    }
+
     u <- par("usr")
     u <- u - rep(at, each = 2)
-    r <- c(range(x[,1], na.rm = TRUE), range(x[,2], na.rm = TRUE))
+    r <- c(range(X[,1], na.rm = TRUE), range(X[,2], na.rm = TRUE))
     ## 'rev' takes care of reversed axes like xlim(1,-1)
     rev <- sign(diff(u))[-2]
     if (rev[1] < 0)
         u[1:2] <- u[2:1]
     if (rev[2] < 0)
         u[3:4] <- u[4:3]
-    u <- u/r 
+    u <- u/r
     u <- u[is.finite(u) & u > 0]
     fill * min(u)
 }
-
diff --git a/R/ordiArrowTextXY.R b/R/ordiArrowTextXY.R
index 08c4393..4316381 100644
--- a/R/ordiArrowTextXY.R
+++ b/R/ordiArrowTextXY.R
@@ -1,18 +1,54 @@
-### Location of the text at the point of the arrow. 'vect' are the
+### Location of the text at the point of the arrow. 'x' are the
 ### coordinates of the arrow heads, and 'labels' are the text used to
 ### label these heads, '...' passes arguments (such as 'cex') to
 ### strwidth() and strheight().
-`ordiArrowTextXY` <-
-    function (vect, labels, ...) 
-{
+`ordiArrowTextXY` <- function (x, labels, display, choices = c(1,2),
+                               rescale = TRUE, fill = 0.75, ...) {
+    ## handle x, which we try with scores, but also retain past usage of
+    ## a two column matrix
+    X <- if (is.matrix(x)) {
+        nc <- NCOL(x)
+        if (nc != 2L) {
+            stop("A 2-column matrix of coordinates is required & not supplied.")
+        }
+        x
+    } else {
+        if (inherits(x, "envfit")) {
+            scores(x, display = "vectors", ...)[, 1:2]
+        } else {
+            scores(x, display = display, choices = choices, ...)
+        }
+        if (!rescale) {
+            warning("Extracted scores usually need rescaling but you set 'rescale = FALSE'.\nConsider using 'rescale = TRUE', the default.")
+        }
+    }
+
+    ## find multiplier to fill if rescaling
+    if (rescale) {
+        mul <- ordiArrowMul(X, fill = fill)
+        X <- X * mul
+    }
+
+    if (missing(labels)) {
+        rnames <- rownames(X)
+        labels <- if (is.null(rnames)) {
+            paste("V", seq_len(NROW(X)))
+        } else {
+            rnames
+        }
+    }
+
     w <- strwidth(labels, ...)
     h <- strheight(labels, ...)
+
     ## slope of arrows
-    b <- vect[,2]/vect[,1]
+    b <- X[,2] / X[,1]
+
     ## offset based on string dimensions
-    off <- cbind(sign(vect[,1]) * (w/2 + h/4), 0.75 * h * sign(vect[,2]))
+    off <- cbind(sign(X[,1]) * (w/2 + h/4), 0.75 * h * sign(X[,2]))
+
     ## move the centre of the string to the continuation of the arrow
-    for(i in 1:nrow(vect)) {
+    for(i in seq_len(nrow(X))) {
         move <- off[i,2] / b[i]
         ## arrow points to the top/bottom of the text box
         if (is.finite(move) && abs(move) <= abs(off[i, 1]))
@@ -21,7 +57,7 @@
             ## arrow points to a side of the text box
             move <- b[i] * off[i,1]
             off[i, 2] <- move
-        }  
+        }
     }
-    off + vect
+    off + X
 }
diff --git a/R/ordiGetData.R b/R/ordiGetData.R
index aedd57a..46736fd 100644
--- a/R/ordiGetData.R
+++ b/R/ordiGetData.R
@@ -6,5 +6,5 @@ function (call, env)
     call$na.action <- na.pass
     call[[2]] <- NULL
     call[[1]] <- as.name("model.frame")
-    eval(call, env)
+    eval(call, env, enclos = .GlobalEnv)
 }
diff --git a/R/ordiParseFormula.R b/R/ordiParseFormula.R
index 664807f..84af261 100644
--- a/R/ordiParseFormula.R
+++ b/R/ordiParseFormula.R
@@ -1,5 +1,5 @@
-"ordiParseFormula" <-
-function (formula, data, xlev = NULL, envdepth = 2, na.action = na.fail,
+`ordiParseFormula` <-
+function (formula, data, xlev = NULL, na.action = na.fail,
           subset = NULL) 
 {
     if (missing(data))
@@ -7,7 +7,7 @@ function (formula, data, xlev = NULL, envdepth = 2, na.action = na.fail,
     Terms <- terms(formula, "Condition", data = data)
     flapart <- fla <- formula <- formula(Terms, width.cutoff = 500)
     specdata <- formula[[2]]
-    X <- eval.parent(specdata, n = envdepth)
+    X <- eval(specdata, environment(formula), enclos=globalenv())
     ## X is usually a matrix, but it is "dist" with capscale():
     X <- as.matrix(X)
     indPartial <- attr(Terms, "specials")$Condition
@@ -19,8 +19,12 @@ function (formula, data, xlev = NULL, envdepth = 2, na.action = na.fail,
         Pterm <- paste(Pterm, collapse = "+")
         P.formula <- as.formula(paste("~", Pterm), env = environment(formula))
         zlev <- xlev[names(xlev) %in% Pterm]
-        zmf <- model.frame(P.formula, data, na.action = na.pass, 
-            xlev = zlev)
+        zmf <- if (inherits(data, "environment"))
+            eval(substitute(
+                model.frame(P.formula, na.action = na.pass, xlev = zlev)),
+                 envir = data, enclos = .GlobalEnv)
+        else
+            model.frame(P.formula, data, na.action = na.pass, xlev = zlev)
         partterm <- sapply(partterm, function(x) deparse(x, width.cutoff=500))
         formula <- update(formula, paste("~.-", paste(partterm, 
             collapse = "-")))
@@ -31,8 +35,13 @@ function (formula, data, xlev = NULL, envdepth = 2, na.action = na.fail,
     else {
         if (exists("Pterm")) 
             xlev <- xlev[!(names(xlev) %in% Pterm)]
-        ymf <- model.frame(formula, data, na.action = na.pass, 
-            xlev = xlev)
+
+        ymf <- if (inherits(data, "environment"))
+            eval(substitute(
+                model.frame(formula, na.action = na.pass, xlev = xlev)),
+                 envir=data, enclos=.GlobalEnv)
+        else
+            model.frame(formula, data, na.action = na.pass, xlev = xlev) 
     }
     ## Combine condition an constrain data frames
     if (!is.null(zmf)) {
diff --git a/R/ordiR2step.R b/R/ordiR2step.R
index b7f8286..6ec05e0 100644
--- a/R/ordiR2step.R
+++ b/R/ordiR2step.R
@@ -13,6 +13,9 @@
     ## Works only for rda(): cca() does not have (yet) R2.adjusted
     if (!inherits(object, "rda"))
         stop("can be used only with rda() or capscale()")
+    ## No R2 for capscale with negative eigenvalues
+    if (inherits(object, "capscale") && !is.null(object$CA$imaginary.chi))
+        stop("cannot be used when capscale() has negative eigenvalues")
     ## Get R2 of the original object
     if (is.null(object$CCA))
         R2.0 <- 0
diff --git a/R/orditkplot.R b/R/orditkplot.R
index bdae5ef..91b6e7f 100644
--- a/R/orditkplot.R
+++ b/R/orditkplot.R
@@ -164,7 +164,8 @@
                        command=function() tcltk::tkpostscript(can, x=0, y=0,
                        height=height, width=width,
                        file=tcltk::tkgetSaveFile(
-                         filetypes="{{EPS file} {.eps}}")))
+                         filetypes="{{EPS file} {.eps}}",
+                         defaultextension=".eps")))
     dismiss <- tcltk::tkbutton(buts, text="Dismiss",
                                command=function() tcltk::tkdestroy(w))
     ## Dump current plot to an "orditkplot" object (internally)
@@ -229,6 +230,7 @@
         xy <- ordDump()
         ftypes <- c("eps" = "{EPS File} {.eps}",
                     "pdf" = "{PDF File} {.pdf}",
+                    "svg" = "{SVG File} {.svg}",
                     "png" = "{PNG File} {.png}",
                     "jpg" = "{JPEG File} {.jpg .jpeg}",
                     "bmp" = "{BMP File} {.bmp}",
@@ -240,11 +242,24 @@
             falt["png"] <- FALSE
         if (!capabilities("jpeg"))
             falt["jpg"] <- FALSE
+        if (!capabilities("cairo"))
+            falt["svg"] <- FALSE
         ## Should work also in R < 2.8.0 with no capabilities("tiff")
         if (!isTRUE(unname(capabilities("tiff"))))
             falt["tiff"] <- FALSE
         ftypes <- ftypes[falt]
-        fname <- tcltk::tkgetSaveFile(filetypes=ftypes)
+        ## External Tcl/Tk in Windows seems to buggy with type
+        ## extensions of the file name: the extension is not
+        ## automatically appended, but defaultextension is interpreted
+        ## wrongly so that its value is not used as extension but
+        ## correct appending is done if defaultextension has any
+        ## value. The following kluge is against Tcl/Tk documentation,
+        ## and should be corrected if Tcl/Tk is fixed.
+        if (.Platform$OS.type == "windows")
+            fname <- tcltk::tkgetSaveFile(filetypes=ftypes,
+                                          defaultextension = TRUE)
+        else
+            fname <- tcltk::tkgetSaveFile(filetypes=ftypes)
         if(tcltk::tclvalue(fname) == "")
             return(NULL)
         fname <- tcltk::tclvalue(fname)
@@ -265,6 +280,7 @@
                eps = postscript(file=fname, width=xy$dim[1], height=xy$dim[2],
                paper="special", horizontal = FALSE),
                pdf = pdf(file=fname, width=xy$dim[1], height=xy$dim[2]),
+               svg = svg(filename=fname, width=xy$dim[1], height=xy$dim[2]),
                png = png(filename=fname, width=pixdim[1], height=pixdim[2]),
                jpg = jpeg(filename=fname, width=pixdim[1], height=pixdim[2],
                quality = 100),
diff --git a/R/pcnm.R b/R/pcnm.R
index 082e0a9..229bce4 100644
--- a/R/pcnm.R
+++ b/R/pcnm.R
@@ -1,6 +1,11 @@
-`pcnm` <-
-    function(dis, threshold, w, dist.ret = FALSE)
-{
+`pcnm` <- function(dis, threshold, w, dist.ret = FALSE) {
+    if (!inherits(dis, "dist")) {
+        dims <- dim(dis)
+        if (length(unique(dims)) >1) {
+            stop("'dis' does not appear to be a square distance matrix.")
+        }
+        dis <- as.dist(dis)
+    }
     EPS <- sqrt(.Machine$double.eps)
     wa.old <- options(warn = -1)
     on.exit(options(wa.old))
@@ -16,7 +21,7 @@
     res <- list(vectors = mypcnm$points, values = mypcnm$eig,
                 weights = mypcnm$weig)
     k <- ncol(mypcnm$points)
-    res$vectors <- sweep(res$vectors, 2, sqrt(res$values[1:k]), "/")
+    res$vectors <- sweep(res$vectors, 2, sqrt(res$values[seq_len(k)]), "/")
     colnames(res$vectors) <- paste("PCNM", 1:k, sep="")
     res$threshold <- threshold
     if (dist.ret) {
diff --git a/R/permustats.R b/R/permustats.R
index 8bebc46..cf523aa 100644
--- a/R/permustats.R
+++ b/R/permustats.R
@@ -55,7 +55,7 @@
 
 `print.summary.permustats` <- function(x, ...) {
     m <- cbind("statistic" = x$statistic,
-               "z" = x$z,
+               "SES" = x$z,
                "mean" = x$means,
                x$quantile)
     cat("\n")
diff --git a/R/plot.cca.R b/R/plot.cca.R
index 833580c..071e9b1 100644
--- a/R/plot.cca.R
+++ b/R/plot.cca.R
@@ -9,7 +9,7 @@
     if (!is.list(g))
         g <- list(default = g)
     ## Take care that there are names
-    for (i in seq_len(length(g))) {
+    for (i in seq_along(g)) {
         if (length(dim(g[[i]])) > 1)
             rownames(g[[i]]) <- rownames(g[[i]], do.NULL = FALSE,
                                          prefix = substr(names(g)[i], 1, 3))
diff --git a/R/plot.meandist.R b/R/plot.meandist.R
index 5e7a702..b3baafa 100644
--- a/R/plot.meandist.R
+++ b/R/plot.meandist.R
@@ -13,24 +13,28 @@
         if (missing(ylim))
             ylim <- range(c(w, tr, root), na.rm = TRUE)
         plot(cl, ylim = ylim, leaflab = "none", axes = axes, ...)
-        for (i in 1:length(w)) segments(i, tr[i], i, w[i])
+        seqw <- seq_along(w)
+        for (i in seqw) {
+            segments(i, tr[i], i, w[i])
+        }
         pos <- ifelse(w < tr, 1, 3)
         pos[is.na(pos)] <- 1
         w[is.na(w)] <- tr[is.na(w)]
-        text(1:length(w), w, labels = labels(cl), pos = pos, srt = 0)
+        text(seqw, w, labels = labels(cl), pos = pos, srt = 0)
     } else {
         w <- diag(x)
+        seqw <- seq_along(w)
         tr <- rep(summary(x)$B, length(w))
         if (missing(ylim))
             ylim <- range(c(w, tr), na.rm = TRUE)
-        plot(1:length(w), tr, ylim = ylim, axes = FALSE, xlab = "", ylab = "",
+        plot(seqw, tr, ylim = ylim, axes = FALSE, xlab = "", ylab = "",
              type = "l", ...)
         if (axes)
             axis(2, ...)
-        for (i in 1:length(w)) segments(i, tr, i, w[i])
+        for (i in seqw) segments(i, tr, i, w[i])
         pos <- ifelse(w < tr, 1, 3)
         pos[is.na(pos)] <- 1
-        text(1:length(w), w, labels = names(n), pos = pos, srt = 0,
+        text(seqw, w, labels = names(n), pos = pos, srt = 0,
              xpd = TRUE, ...)
     }
 }
diff --git a/R/plot.radfit.frame.R b/R/plot.radfit.frame.R
index a9316b0..9555438 100644
--- a/R/plot.radfit.frame.R
+++ b/R/plot.radfit.frame.R
@@ -18,7 +18,7 @@
     }
     Nhm <- length(x)
     Abundance <- unlist(lapply(x, function(x) x$y))
-    Rank <- unlist(lapply(x, function(x) if (length(x$y) > 0) 1:length(x$y) else NULL))
+    Rank <- unlist(lapply(x, function(x) if (length(x$y) > 0) seq_along(x$y) else NULL))
     Site <- unlist(lapply(x, function(x) length(x$y)))
     N <- Site
     sitenames <- names(Site)
@@ -33,10 +33,10 @@
     take <- sapply(x, function(x) pickmod(x, pick, BIC))
     take <- rep(take, N)
     cols <- trellis.par.get("superpose.line")$col
-    cols <- cols[1:length(cols)]
+    cols <- cols[seq_along(cols)]
     if (legend) {
         mykey <- list(text = list(text = modnam), lines = list(lty = 1, 
-                                                  col = cols[1:length(modnam)], lwd = 2), columns = 3)
+                                                  col = cols[seq_along(modnam)], lwd = 2), columns = 3)
     }
     else {
         mykey <- NULL
diff --git a/R/plot.specaccum.R b/R/plot.specaccum.R
index 5c19246..d907734 100644
--- a/R/plot.specaccum.R
+++ b/R/plot.specaccum.R
@@ -4,8 +4,10 @@
              ci.lty = 1, xlab, ylab = x$method, ylim,
              xvar = c("sites", "individuals", "effort"), ...)
 {
-    if(random && x$method != "random")
+    if(random && !(x$method %in% c("random", "collector")))
         stop("random = TRUE can be used only with method='random'")
+    if(x$method == "collector")
+        random <- TRUE
     xvar <- match.arg(xvar)
     ## adjust weights to number of sites
     if (random && !is.null(x$weights) && xvar == "sites") {
diff --git a/R/predict.fitspecaccum.R b/R/predict.fitspecaccum.R
index 4ce8231..dcca4ed 100644
--- a/R/predict.fitspecaccum.R
+++ b/R/predict.fitspecaccum.R
@@ -1,3 +1,7 @@
+### fitspecaccum returns fitted nls() models in item models. Here we
+### provide interfaces for some "nls" class support functions, and
+### others can be used in the similar way.
+
 `predict.fitspecaccum` <-
     function(object, newdata, ...)
 {
@@ -11,3 +15,15 @@
         drop(sapply(mods, predict, ...))
     }
 }
+
+`AIC.fitspecaccum` <-
+    function(object, ..., k = 2)
+{
+    sapply(object$models, AIC, k = k, ...)
+}
+
+`deviance.fitspecaccum` <-
+    function(object, ...)
+{
+    sapply(object$models, deviance, ...)
+}
diff --git a/R/predict.specaccum.R b/R/predict.specaccum.R
index c733877..e19a9bf 100644
--- a/R/predict.specaccum.R
+++ b/R/predict.specaccum.R
@@ -8,12 +8,43 @@
         newdata <- drop(as.matrix(newdata))
         if (length(dim(newdata)) > 1)
             stop("function accepts only one variable as 'newdata'")
-        if (interpolation == "linear")
-            out <- approx(x = object$sites, y = object$richness,
-                          xout = newdata, rule = 1)$y
-        else
-            out <- spline(x = object$sites, y = object$richness,
-                          xout = newdata, ...)$y
+        ## Estimation uses lchoose(), but for predict we need to
+        ## estimates on non-integer sample sizes and therefore we use
+        ## lgamma(). Original "rarefaction" used sample sizes rounded
+        ## to integers, but here we can use non-integer data and hence
+        ## get different results.
+        if (object$method %in% c("exact", "rarefaction")) {
+            lg <- function(n, k) {
+                ifelse(k <= n, lgamma(pmax(n, 0) + 1) - lgamma(k+1) -
+                    lgamma(pmax(n-k, 0) + 1), -Inf)
+            }
+            if (object$method == "exact")
+                n <- length(object$sites)
+            else {
+                n <- sum(object$freq)
+                newdata <- newdata / length(object$sites) * n
+            }
+            ldiv <- lg(n, newdata)
+            out <- numeric(length(ldiv))
+            for(i in seq_along(newdata)) {
+                out[i] <- sum(1 - exp(lg(n-object$freq, newdata[i])
+                                      - ldiv[i]))
+            }
+        } else if (object$method == "coleman") {
+            ## "coleman" also works on non-integer newdata
+            n <- length(object$sites)
+            out <- sapply(newdata,
+                          function(x) sum(1 - (1 - x/n)^object$freq))
+        } else {
+            ## Other methods do not accept non-integer newdata, but we
+            ## can interpolate
+            if (interpolation == "linear")
+                out <- approx(x = object$sites, y = object$richness,
+                              xout = newdata, rule = 1)$y
+            else
+                out <- spline(x = object$sites, y = object$richness,
+                              xout = newdata, ...)$y
+        }
     }
     out
 }
diff --git a/R/print.oecosimu.R b/R/print.oecosimu.R
index bbf317b..433c6c8 100644
--- a/R/print.oecosimu.R
+++ b/R/print.oecosimu.R
@@ -32,7 +32,7 @@
                     less = c(0.05, 0.5))
     qu <- apply(x$oecosimu$simulated, 1, quantile, probs=probs, na.rm = TRUE)
     m <- cbind("statistic" = x$oecosimu$statistic,
-               "z" = x$oecosimu$z, "mean" = x$oecosimu$means, t(qu),
+               "SES" = x$oecosimu$z, "mean" = x$oecosimu$means, t(qu),
                "Pr(sim.)"=x$oecosimu$pval)
     printCoefmat(m, cs.ind = 3:(ncol(m)-1), ...)
     if (any(is.na(x$oecosimu$simulated))) {
diff --git a/R/print.specaccum.R b/R/print.specaccum.R
index c0bb1cf..0de71c3 100644
--- a/R/print.specaccum.R
+++ b/R/print.specaccum.R
@@ -2,6 +2,8 @@
     function(x, ...)
 {
     cat("Species Accumulation Curve\n")
+    if (inherits(x, "fitspecaccum"))
+        cat("Non-linear regression model:", x$SSmodel, "\n")
     cat("Accumulation method:", x$method)
     if (x$method == "random") {
         cat(", with ", ncol(x$perm), " permutations", sep="")
diff --git a/R/print.varpart.R b/R/print.varpart.R
index 179450e..5b063a2 100644
--- a/R/print.varpart.R
+++ b/R/print.varpart.R
@@ -1,5 +1,5 @@
 "print.varpart" <-
-function (x, ...) 
+function (x, ...)
 {
     cat("\nPartition of variation in RDA\n\n")
     writeLines(strwrap(pasteCall(x$call)))
@@ -9,7 +9,7 @@ function (x, ...)
         cat("Species transformation: ", x$transfo)
     cat("\n")
     cat("Explanatory tables:\n")
-    cat(paste(paste(paste("X", 1:length(x$tables), sep=""),":  ",
+    cat(paste(paste(paste("X", seq_along(x$tables), sep=""),":  ",
                     x$tables, sep=""), collapse="\n"), "\n\n")
     print(x$part, ...)
     invisible(x)
diff --git a/R/print.varpart234.R b/R/print.varpart234.R
index 9adb205..b9736ee 100644
--- a/R/print.varpart234.R
+++ b/R/print.varpart234.R
@@ -16,7 +16,7 @@ function(x, digits = 5, ...)
     print(out)
     cat("---\nUse function 'rda' to test significance of fractions of interest\n")
     if (!is.null(x$bigwarning))
-        for (i in 1:length(x$bigwarning))
+        for (i in seq_along(x$bigwarning))
             warning("collinearity detected: redundant variable(s)  between tables ",
                     x$bigwarning[i],
                     "\nresults are probably incorrect: remove redundant variable(s) and repeat the analysis",
diff --git a/R/rankindex.R b/R/rankindex.R
index 36c8282..3bdff32 100644
--- a/R/rankindex.R
+++ b/R/rankindex.R
@@ -25,7 +25,7 @@ function (grad, veg, indices = c("euc", "man", "gow", "bra",
     names(res) <- nam
     ## indices is a list of functions which return dist objects
     if (is.list(indices)) {
-        for (i in 1:length(indices)) {
+        for (i in seq_along(indices)) {
             ## don't accept similarities
             if (indices[[i]](matrix(1, 2, 2)) != 0)
                 stop("define dissimilarity and not similarity")
diff --git a/R/rarecurve.R b/R/rarecurve.R
index a540d72..970a955 100644
--- a/R/rarecurve.R
+++ b/R/rarecurve.R
@@ -33,7 +33,7 @@
         abline(h = rare, lwd=0.5)
     }
     ## rarefaction curves
-    for (ln in seq_len(length(out))) {
+    for (ln in seq_along(out)) {
         N <- attr(out[[ln]], "Subsample")
         lines(N, out[[ln]], col = col[ln], lty = lty[ln], ...)
     }
diff --git a/R/rarefy.R b/R/rarefy.R
index 7a3188b..9443b2a 100644
--- a/R/rarefy.R
+++ b/R/rarefy.R
@@ -2,6 +2,11 @@
     function (x, sample, se = FALSE, MARGIN = 1) 
 {
     x <- as.matrix(x)
+    minsample <- min(apply(x, MARGIN, sum))
+    if (any(sample > minsample))
+        warning(
+            gettextf("Requested 'sample' was larger than smallest site maximum (%d)",
+                     minsample))
     ## as.matrix changes an n-vector to a n x 1 matrix
     if (ncol(x) == 1 && MARGIN == 1)
         x <- t(x)
diff --git a/R/rareslope.R b/R/rareslope.R
new file mode 100644
index 0000000..c21c3b4
--- /dev/null
+++ b/R/rareslope.R
@@ -0,0 +1,42 @@
+#' Slope of Rarefunction Curve at Given Sample Size
+#'
+#' Function evaluates the derivative of the rarefaction
+#' function at given sample size. The derivative was
+#' directly derived from the expression used in \code{rarefy}.
+#'
+#' @param x Community counts, either an integer vector for a single
+#' site or a data frame or matrix with each row giving site vectors.
+#' @param sample Sample sizes where the derivatives are evaluated; can
+#' be real
+#'
+`rareslope` <-
+    function(x, sample)
+{
+    ## 'x' must be integers ('sample' need not be)
+    if (!identical(all.equal(x, round(x)), TRUE))
+        stop("community data 'x' must be integers (counts)")
+    slope <- function(x, sample) {
+        x <- x[x>0]
+        J <- sum(x)
+        ## Replace Hurlbert's factorials with gamma() functions and do
+        ## some algebra for derivatives. NB., rarefy() does not use
+        ## factorials but lchoose directly.
+        d <- digamma(pmax(J-sample+1, 1)) - digamma(pmax(J-x-sample+1, 1))
+        g <- lgamma(pmax(J-x+1, 1)) + lgamma(pmax(J-sample+1, 1)) -
+            lgamma(pmax(J-x-sample+1, 1)) - lgamma(J+1)
+        d <- d*exp(g)
+        sum(d[is.finite(d)])
+    }
+    if (length(dim(x)) == 2)
+        out <- sapply(sample, function(n) apply(x, 1, slope, sample = n))
+    else
+        out <- sapply(sample, function(n) slope(x, sample=n))
+    out <- drop(out)
+    if (length(sample) > 1) {
+        if (is.matrix(out))
+            colnames(out) <- paste0("N", sample)
+        else
+            names(out) <- paste0("N", sample)
+    }
+    out
+}
diff --git a/R/rda.default.R b/R/rda.default.R
index 8b7cff1..0b4ffa0 100644
--- a/R/rda.default.R
+++ b/R/rda.default.R
@@ -5,6 +5,11 @@
     CCA <- NULL
     pCCA <- NULL
     CA <- NULL
+    ## Protect against grave misuse: some people have used
+    ## dissimilarities instead of data
+    if (inherits(X, "dist") || NCOL(X) == NROW(X) &&
+        isTRUE(all.equal(X, t(X))))
+        stop("function cannot be used with (dis)similarities")
     X <- as.matrix(X)
     NR <- nrow(X) - 1
     Xbar <- scale(X, center = TRUE, scale = scale)
@@ -41,7 +46,7 @@
         ## it can happen that rank < qrank
         rank <- min(rank, sum(sol$d > (sol$d[1L] * ZERO)))
         sol$d <- sol$d/sqrt(NR)
-        ax.names <- paste("RDA", 1:length(sol$d), sep = "")
+        ax.names <- paste("RDA", seq_along(sol$d), sep = "")
         colnames(sol$u) <- ax.names
         colnames(sol$v) <- ax.names
         names(sol$d) <- ax.names
diff --git a/R/read.cep.R b/R/read.cep.R
index 19fc89c..01aea45 100644
--- a/R/read.cep.R
+++ b/R/read.cep.R
@@ -72,10 +72,10 @@
   if (trace) 
     cat("Read", cd$nsp, "species, ", cd$nst, "sites.\n")
   d <- matrix(0, cd$nst, cd$nsp)
-  for (i in 1:length(cd$i)) d[cd$i[i], cd$j[i]] <- cd$y[i]
+  for (i in seq_along(cd$i)) d[cd$i[i], cd$j[i]] <- cd$y[i]
   nlines <- ceiling(cd$nsp/10)
   names <- NULL
-  for (i in 1:nlines) {
+  for (i in seq_len(nlines)) {
     tmpnames <- .Fortran("cepnames", character(1), PACKAGE = "vegan")
     tmpnames <- substring(as.character(tmpnames), 1, 80)
     tmpnames <- substring(tmpnames, seq(1, 80, by = 8), seq(8, 
@@ -84,10 +84,10 @@
   }
   names <- gsub(" ", "", names)
   names <- make.names(names, unique = TRUE)
-  colnames(d) <- names[1:ncol(d)]
+  colnames(d) <- names[seq_len(ncol(d))]
   nlines <- ceiling(cd$nst/10)
   names <- NULL
-  for (i in 1:nlines) {
+  for (i in seq_len(nlines)) {
     tmpnames <- .Fortran("cepnames", character(1), PACKAGE = "vegan")
     tmpnames <- substring(as.character(tmpnames), 1, 80)
     tmpnames <- substring(tmpnames, seq(1, 80, by = 8), seq(8, 
@@ -96,7 +96,7 @@
   }
   names <- gsub(" ", "", names)
   names <- make.names(names, unique = TRUE)
-  rownames(d) <- names[1:nrow(d)]
+  rownames(d) <- names[seq_len(nrow(d))]
   if (positive) {
     rsum <- apply(d, 1, sum)
     csum <- apply(d, 2, sum)
diff --git a/R/scores.cca.R b/R/scores.cca.R
index 3c7f98c..2c76ef1 100644
--- a/R/scores.cca.R
+++ b/R/scores.cca.R
@@ -92,7 +92,7 @@
     }
     ## Take care that scores have names
     if (length(sol)) {
-        for (i in 1:length(sol)) {
+        for (i in seq_along(sol)) {
             if (is.matrix(sol[[i]])) 
                 rownames(sol[[i]]) <-
                     rownames(sol[[i]], do.NULL = FALSE, 
@@ -102,5 +102,5 @@
     ## Only one type of scores: return a matrix instead of a list
     if (length(sol) == 1) 
         sol <- sol[[1]]
-    return(sol)
+    sol
 }
diff --git a/R/scores.ordihull.R b/R/scores.ordihull.R
index cadd6b1..43f5943 100644
--- a/R/scores.ordihull.R
+++ b/R/scores.ordihull.R
@@ -3,7 +3,7 @@
     function(x, ...)
 {
     out <- NULL
-    for(i in 1:length(x))
+    for(i in seq_along(x))
         out <- rbind(out, x[[i]])
     hulls <- rep(names(x), sapply(x, function(z) NROW(z)))
     attr(out, "hulls") <- hulls
diff --git a/R/scores.rda.R b/R/scores.rda.R
index b8798c9..9cc38c6 100644
--- a/R/scores.rda.R
+++ b/R/scores.rda.R
@@ -95,7 +95,7 @@
     }
     ## Take care that scores have names
     if (length(sol)) {
-        for (i in 1:length(sol)) {
+        for (i in seq_along(sol)) {
             if (is.matrix(sol[[i]])) 
                 rownames(sol[[i]]) <-
                     rownames(sol[[i]], do.NULL = FALSE, 
@@ -109,5 +109,5 @@
     if (identical(const[1], const[2]))
         const <- const[1]
     attr(sol, "const") <- const
-    return(sol)
+    sol
 }
diff --git a/R/showvarparts.R b/R/showvarparts.R
index cdff16a..ffabf2a 100644
--- a/R/showvarparts.R
+++ b/R/showvarparts.R
@@ -1,24 +1,74 @@
-"showvarparts" <-
-function(parts = 2, labels, ...)
+`showvarparts` <-
+    function(parts, labels, bg = NULL, alpha=63, Xnames, id.size=1.2, ...)
 {
     rad <- 0.725
+    ## Default names
+    if (missing(Xnames))
+        Xnames <- paste("X", seq_len(parts), sep="")
+    ## transparent fill colours
+    if (!is.null(bg)) {
+        bg <- rgb(t(col2rgb(bg)), alpha = alpha, maxColorValue = 255)
+        if (length(bg) < parts)
+            bg <- rep(bg, length.out = parts)
+    }
+    ## centroids of circles (parts < 4) or individual fractions (parts
+    ## == 4)
     cp <- switch(parts,
-                 c(0,0),
-                 c(0,0, 1,0),
-                 c(0,0, 1,0, 0.5, -sqrt(3/4)),
-                 c(-0.5,0.3, 0.5, 0.3, 0, -sqrt(3/4)+0.3)
+                 matrix(c(0,0), ncol=2, byrow=TRUE),
+                 matrix(c(0,0, 1,0), ncol=2, byrow=TRUE),
+                 matrix(c(0,0, 1,0, 0.5, -sqrt(3/4)), ncol=2, byrow=TRUE),
+                 structure(
+                     c(-1.2, -0.6, 0.6, 1.2, -0.7, 0, -0.7, 0, 0.7, 0.7,
+                       0.3, -0.4, 0.4, -0.3, 0, 0, 0.7, 0.7, 0, 0.3, 0.4,
+                       -0.6,-1.2, -0.6, 0.3, -0.7, 0, 0, -0.7, -0.4),
+                     .Dim = c(15L, 2L))
                  )
-    cp <- matrix(cp, ncol=2, byrow=TRUE)
+    ## plot limits
+    if (parts < 4) {
+        xlim <- range(cp[,1]) + c(-rad, rad)
+        ylim <- range(cp[,2]) + c(-rad, rad)
+    } else {
+        xlim <- c(-1.7, 1.7)
+        ylim <- c(-1.7, 1.1)
+    }
+    ## plot
     plot(cp, axes=FALSE, xlab="", ylab="", asp=1, type="n", 
-         xlim = (range(cp[,1]) + c(-rad, rad)),
-         ylim = (range(cp[,2]) + c(-rad, rad)))
+         xlim = xlim, ylim = ylim)
     box()
-    symbols(cp, circles = rep(rad, min(parts,3)), inches = FALSE, add=TRUE, ...)
-    if (parts == 4) {
-        symbols(0, 0.2, rectangles=cbind(1, 0.5), inches=FALSE, add=TRUE, ...)
-        symbols(sqrt(1/2), -sqrt(3/4)+0.2, rectangles=cbind(0.5,0.3),
-                inches=FALSE, add=TRUE, ...)
+    if (parts < 4) {
+        symbols(cp, circles = rep(rad, min(parts,3)), inches = FALSE,
+                add=TRUE, bg = bg, ...)
+        ## Explanatory data set names added by PL
+        if(parts==2) {
+            pos.names = matrix(c(-0.65,1.65,0.65,0.65),2,2)
+        } else if(parts==3) {
+            pos.names = matrix(c(-0.65,1.65,-0.16,0.65,0.65,-1.5),3,2)
+        }
+        text(pos.names,labels=Xnames[1:parts], cex=id.size)
+    } else {
+        ## Draw ellipses with veganCovEllipse. Supply 2x2
+        ## matrix(c(d,a,a,d), 2, 2) which defines an ellipse of
+        ## semi-major axis length sqrt(d+a) semi-minor axis sqrt(d-a).
+        d <- 1
+        a <- 1/sqrt(2)
+        ## Small ellipses X2, X3 at the centroid
+        e2 <- veganCovEllipse(matrix(c(d,-a,-a,d), 2, 2))
+        e3 <- veganCovEllipse(matrix(c(d, a, a,d), 2, 2))
+        ## wider ellipses X1, X4 at sides going through the centroid
+        L <- d+a
+        W <- (sqrt(L) - sqrt(d-a))^2
+        d <- (L+W)/2
+        a <- (L-W)/2
+        cnt <- sqrt(W/2)
+        e1 <- veganCovEllipse(matrix(c(d,-a,-a,d), 2, 2), c(-cnt, -cnt))
+        e4 <- veganCovEllipse(matrix(c(d, a, a,d), 2, 2), c( cnt, -cnt))
+        polygon(rbind(e1,NA,e2,NA,e3,NA,e4), col = bg, ...)
+        ## Explanatory data set names added by PL
+        pos.names = matrix(c(-1.62,-1.10,1.10,1.62,0.54,1.00,1.00,0.54),4,2)
+        text(pos.names,labels=Xnames[1:4], cex=id.size)
     }
+    
+    ## label fractions
     nlabs <- switch(parts, 2, 4, 8, 16)
     if (missing(labels))
         labels <- paste("[", letters[1:nlabs], "]", sep="")
@@ -29,19 +79,10 @@ function(parts = 2, labels, ...)
            text(rbind(cp[1,], colMeans(cp), cp[2,]), labels[-nlabs], ...),
            text(rbind(cp, colMeans(cp[1:2,]), colMeans(cp[2:3,]),
                       colMeans(cp[c(1,3),]), colMeans(cp)), labels[-nlabs], ...),
-           text(rbind(1.4*cp, c(0.8, -sqrt(3/4)+0.2),
-                      colMeans(cp[1:2,]) + c(0,0.25),
-                      colMeans(cp[2:3,]), colMeans(cp[c(1,3),]),
-                      cp[1,] + c(0.1,0), cp[2,] -c(0.1,0),
-                      c(0.6, -sqrt(3/4)+0.2), colMeans(cp[1:2,]),
-                      colMeans(cp)-c(0,0.12), colMeans(cp[2:3,]) + c(0,0.14),
-                      colMeans(cp[c(1,3),]) + c(0, 0.14),
-                      colMeans(cp) + c(0,0.08)),
-                labels[-nlabs], ...)
+           text(cp, labels[-nlabs], ...)
            )
     xy <- par("usr")
     text(xy[2] - 0.05*diff(xy[1:2]), xy[3] + 0.05*diff(xy[3:4]),
          paste("Residuals =", labels[nlabs]), pos = 2, ...)
     invisible()
 }
-
diff --git a/R/specaccum.R b/R/specaccum.R
index 940e70b..e354ca7 100644
--- a/R/specaccum.R
+++ b/R/specaccum.R
@@ -30,11 +30,13 @@
         sites <- 1:n
         xout <- weights <- cumsum(w)
         specaccum <- accumulator(x, sites)
+        perm <- as.matrix(specaccum)
+        weights <- as.matrix(weights)
     }, random = {
         permat <- getPermuteMatrix(permutations, n)
         perm <- apply(permat, 1, accumulator, x = x)
         if (!is.null(w))
-            weights <- apply(permat, 1, function(i) cumsum(w[i]))
+            weights <- as.matrix(apply(permat, 1, function(i) cumsum(w[i])))
         sites <- 1:n
         if (is.null(w)) {
             specaccum <- apply(perm, 1, mean)
@@ -42,7 +44,7 @@
         } else {
             sumw <- sum(w)
             xout <- seq(sumw/n, sumw, length.out = n)
-            intx <- sapply(seq_len(n), function(i)
+            intx <- sapply(seq_len(NCOL(perm)), function(i)
                            approx(weights[,i], perm[,i], xout = xout)$y)
             specaccum <- apply(intx, 1, mean)
             sdaccum <- apply(intx, 1, sd)
@@ -109,6 +111,9 @@
     }
     if (method == "rarefaction")
         out$individuals <- ind
+    ## return 'freq' for methods that are solely defined by them
+    if (method %in% c("exact", "rarefaction", "coleman"))
+        out$freq <- freq
     if (method == "random")
         attr(out, "control") <- attr(permat, "control")
     class(out) <- "specaccum"
diff --git a/R/specslope.R b/R/specslope.R
new file mode 100644
index 0000000..75bc276
--- /dev/null
+++ b/R/specslope.R
@@ -0,0 +1,95 @@
+#' The Slope of Species Accumulation Curve at Given Point
+#' 
+#' Function evaluates the derivative of the species accumulation curve
+#' for accumulation methods built upon analytic accumulation
+#' methods. These methods are \code{exact}, \code{rarefaction} and
+#' \code{coleman}. These methods can be evaluated at any sample size,
+#' including non-integer values. For other methods, you must look at
+#' the differences between consecutive steps, using
+#' \code{diff(predict(mod))}.
+#'
+#' @param object \code{specaccum} result object fitted with methods
+#' \code{"exact"}, \code{"rarefaction"} or \code{"coleman"}.
+#' @param at The sample size (number of sites) at which the slope is
+#' evaluated. This need not be an integer.
+
+`specslope` <-
+    function(object, at)
+{
+    UseMethod("specslope")
+}
+
+`specslope.specaccum` <-
+    function(object, at)
+{
+    accepted <- c("exact", "rarefaction", "coleman")
+    if (!(object$method %in% accepted))
+        stop("accumulation method must be one of: ",
+             paste(accepted, collapse=", "))
+    ## Funcions should accept a vector of 'at', but usually they
+    ## don't. I don't care to change this, and therefore we check the
+    ## input.
+    if (length(at) > 1 && object$method %in% c("exact", "coleman"))
+        stop("'at' can only have a single value")
+    ## The following functions are completely defined by species
+    ## frequencies
+    f <- object$freq
+    n <- length(object$sites)
+    switch(object$method,
+           exact = {
+               d <- digamma(pmax(n-at+1, 1)) - digamma(pmax(n-f-at+1, 1))
+               g <- lgamma(pmax(n-f+1,1)) + lgamma(pmax(n-at+1,1)) -
+                   lgamma(pmax(n-f-at+1, 1)) - lgamma(n+1)
+               d <- d*exp(g)
+               sum(d[is.finite(d)])
+           },
+           rarefaction = {
+               ## fractional number of individuals at 'at', and slope
+               ## for adding whole site instead of one individual
+               rareslope(f, at/n*sum(f)) * sum(f)/n
+           },
+           coleman = {
+               sum((1 - at/n)^f*f/(n - at))
+           })
+}
+
+## Analytical derivatives for NLS regression models in fitspecaccum
+
+`specslope.fitspecaccum` <-
+    function(object, at)
+{
+    ## functions for single set of fitted parameters. Parameters are
+    ## given as a single vector 'p' as returned by coef(). Below a
+    ## table of original names of 'p':
+
+    ## arrhenius, gitay, gleason: k slope
+    ## lomolino: Asym xmid slope
+    ## asymp: Asym RO lrc
+    ## gompertz: Asym b2 b3
+    ## michaelis-menten: Vm K (function SSmicmen)
+    ## logis: Asym xmid scal
+    ## weibull: Asym Drop lrc pwr
+    slope <-
+        switch(object$SSmodel,
+               "arrhenius" = function(x,p) p[1]*x^(p[2]-1)*p[2],
+               "gitay" = function(x,p) 2*(p[1]+p[2]*log(x))*p[2]/x,
+               "gleason" = function(x,p) p[2]/x,
+               "lomolino" = function(x,p) p[1]*p[3]^log(p[2]/x)*log(p[3])/
+                   (1+p[3]^log(p[2]/x))^2/x,
+               "asymp" = function(x,p) (p[1]-p[2])*exp(p[3]-exp(p[3])*x),
+               "gompertz" = function(x,p) -p[1]*p[2]*p[3]^x*
+                   log(p[3])*exp(-p[2]*p[3]^x),
+               "michaelis-menten" = function(x,p) p[1]*p[2]/(p[2]+x)^2,
+               "logis" = function(x,p) p[1]*exp((x-p[2])/p[3])/
+                   (1 + exp((x-p[2])/p[3]))^2/p[3],
+               "weibull" = function(x, p) p[2]*exp(p[3]-exp(p[3])*x^p[4])*
+               x^(p[4]-1)*p[4])
+    ## Apply slope with fitted coefficients at 'at'
+    p <- coef(object)
+    if (is.matrix(p))          # several fitted models
+        out <- apply(p, 2, function(i) slope(at, i))
+    else                       # single site drops to a vector
+        out <- slope(at, p)
+    names(out) <- NULL
+    out
+}
diff --git a/R/summary.anosim.R b/R/summary.anosim.R
index ba96071..bbd7139 100644
--- a/R/summary.anosim.R
+++ b/R/summary.anosim.R
@@ -1,5 +1,5 @@
 `summary.anosim` <-
-function (object, ...) 
+function (object, ...)
 {
    print(object)
    if (object$permutations) {
@@ -10,12 +10,12 @@ function (object, ...)
    cat("\n")
    tmp <- tapply(object$dis.rank, object$class.vec, quantile)
    out <- matrix(NA, length(tmp), 5)
-   for (i in 1:length(tmp)) out[i,] <- tmp[[i]]
+   for (i in seq_along(tmp)) out[i,] <- tmp[[i]]
    rownames(out) <- names(tmp)
    colnames(out) <- names(tmp$Between)
    out <- cbind(out, N = table(object$class.vec))
    cat("Dissimilarity ranks between and within classes:\n")
    print(out)
-   cat("\n") 
+   cat("\n")
    invisible()
 }
diff --git a/R/summary.bioenv.R b/R/summary.bioenv.R
index 778ade7..3eb4c4f 100644
--- a/R/summary.bioenv.R
+++ b/R/summary.bioenv.R
@@ -3,7 +3,7 @@
 {
     x <- object$models
     nam <- object$names
-    size <- seq(1:length(x))
+    size <- seq_along(x)
     cor <- unlist(lapply(x, function(tmp) tmp$est))
     pars <- unlist(lapply(x, function(tmp) paste(nam[tmp$best], collapse=" ")))
     out <- list(size = size, correlation = cor, variables = pars)
diff --git a/R/summary.cca.R b/R/summary.cca.R
index 7e6f66b..0fbfbf0 100644
--- a/R/summary.cca.R
+++ b/R/summary.cca.R
@@ -19,7 +19,7 @@
         names(summ) <- nms[display]
     }
     if (length(display) > 0) {
-        for (i in 1:length(summ)) {
+        for (i in seq_along(summ)) {
             if (is.matrix(summ[[i]]))
                 rownames(summ[[i]]) <-
                     rownames(summ[[i]], do.NULL = FALSE,
@@ -37,7 +37,7 @@
     summ$cont <- summary(eigenvals(object))
     if (!is.null(object$CCA))
         summ$concont <- summary(eigenvals(object, constrained = TRUE))
-    summ$ev.head <- c(summ$ev.con, summ$ev.uncon)[1:axes]
+    summ$ev.head <- c(summ$ev.con, summ$ev.uncon)[seq_len(axes)]
     summ$scaling <- scaling
     summ$digits <- digits
     summ$inertia <- object$inertia
diff --git a/R/summary.radfit.frame.R b/R/summary.radfit.frame.R
index 95c9769..b98d445 100644
--- a/R/summary.radfit.frame.R
+++ b/R/summary.radfit.frame.R
@@ -1,8 +1,8 @@
 "summary.radfit.frame" <-
-function (object, ...) 
+function (object, ...)
 {
     labels <- names(object)
-    for (i in 1:length(labels)) {
+    for (i in seq_along(labels)) {
         cat("\n***", labels[i], "***\n")
         print(object[[i]], ...)
     }
diff --git a/R/varpart.R b/R/varpart.R
index beb3baf..131c005 100644
--- a/R/varpart.R
+++ b/R/varpart.R
@@ -1,22 +1,22 @@
 `varpart` <-
-    function (Y, X, ..., data, transfo, scale = FALSE) 
+    function (Y, X, ..., data, transfo, scale = FALSE)
 {
-    if (missing(data)) 
+    if (missing(data))
         data <- parent.frame()
     X <- list(X, ...)
-    if ((length(X) < 2 || length(X) > 4)) 
+    if ((length(X) < 2 || length(X) > 4))
         stop("needs 2 to 4 explanatory tables")
     if (!missing(transfo)) {
         Y <- decostand(Y, transfo)
         transfo <- attr(Y, "decostand")
     }
-    if (!missing(transfo) && (is.null(dim(Y)) || ncol(Y) == 1)) 
+    if (!missing(transfo) && (is.null(dim(Y)) || ncol(Y) == 1))
         warning("Transformations probably are meaningless to a single variable")
-    if (scale && !missing(transfo)) 
+    if (scale && !missing(transfo))
         warning("Y should not be both transformed and scaled (standardized)")
     Y <- scale(Y, center = TRUE, scale = scale)
     Sets <- list()
-    for (i in 1:length(X)) {
+    for (i in seq_along(X)) {
         if (inherits(X[[i]], "formula")) {
             mf <- model.frame(X[[i]], data, na.action = na.fail,
                               drop.unused.levels = TRUE)
@@ -33,14 +33,14 @@
     out <- list()
     out$part <- switch(length(Sets), NULL,
                        varpart2(Y, Sets[[1]], Sets[[2]]),
-                       varpart3(Y, Sets[[1]], Sets[[2]], Sets[[3]]), 
+                       varpart3(Y, Sets[[1]], Sets[[2]], Sets[[3]]),
                        varpart4(Y, Sets[[1]], Sets[[2]], Sets[[3]], Sets[[4]]))
     out$scale <- scale
-    if (!missing(transfo)) 
+    if (!missing(transfo))
         out$transfo <- transfo
     out$call <- match.call()
     mx <- rep(" ", length(X))
-    for (i in 1:length(X)) mx[i] <- deparse(out$call[[i+2]], width.cutoff = 500)
+    for (i in seq_along(X)) mx[i] <- deparse(out$call[[i+2]], width.cutoff = 500)
     out$tables <- mx
     class(out) <- c("varpart", class(out))
     out
diff --git a/R/vegemite.R b/R/vegemite.R
index 16b89a0..85c88c6 100644
--- a/R/vegemite.R
+++ b/R/vegemite.R
@@ -1,21 +1,21 @@
 `vegemite` <-
-    function (x, use, scale, sp.ind = NULL, site.ind = NULL, zero = ".", 
-              select, ...) 
+    function (x, use, scale, sp.ind = NULL, site.ind = NULL, zero = ".",
+              select, ...)
 {
     if (!missing(use)) {
         if (!is.list(use) && is.vector(use)) {
-            if (is.null(site.ind)) 
+            if (is.null(site.ind))
                 site.ind <- order(use)
-            if (is.null(sp.ind)) 
+            if (is.null(sp.ind))
                 sp.ind <- order(wascores(use, x))
         }
         else if (inherits(use, c("hclust", "twins"))) {
             if (inherits(use, "twins")) {
                 use <- as.hclust(use)
             }
-            if (is.null(site.ind)) 
+            if (is.null(site.ind))
                 site.ind <- use$order
-            if (is.null(sp.ind)) 
+            if (is.null(sp.ind))
                 sp.ind <- order(wascores(order(site.ind), x))
         }
         else if (inherits(use, "dendrogram")) {
@@ -24,35 +24,35 @@
                 names(site.ind) <- rownames(x)
                 site.ind <- site.ind[labels(use)]
             }
-            if (is.null(sp.ind)) 
+            if (is.null(sp.ind))
                 sp.ind <- order(wascores(order(site.ind), x))
         }
         else if (is.list(use)) {
             tmp <- scores(use, choices = 1, display = "sites")
-            if (is.null(site.ind)) 
+            if (is.null(site.ind))
                 site.ind <- order(tmp)
-            if (is.null(sp.ind)) 
-                sp.ind <- try(order(scores(use, choices = 1, 
+            if (is.null(sp.ind))
+                sp.ind <- try(order(scores(use, choices = 1,
                                            display = "species")))
-            if (inherits(sp.ind, "try-error")) 
+            if (inherits(sp.ind, "try-error"))
                 sp.ind <- order(wascores(tmp, x))
         }
         else if (is.matrix(use)) {
             tmp <- scores(use, choices = 1, display = "sites")
-            if (is.null(site.ind)) 
+            if (is.null(site.ind))
                 site.ind <- order(tmp)
-            if (is.null(sp.ind)) 
+            if (is.null(sp.ind))
                 sp.ind <- order(wascores(tmp, x))
         }
     }
     if (!is.null(sp.ind) && is.logical(sp.ind))
-        sp.ind <- (1:ncol(x))[sp.ind]
+        sp.ind <- seq_len(ncol(x))[sp.ind]
     if (!is.null(site.ind) && is.logical(site.ind))
-        site.ind <- (1:nrow(x))[site.ind]
-    if (is.null(sp.ind)) 
-        sp.ind <- 1:ncol(x)
-    if (is.null(site.ind)) 
-        site.ind <- 1:nrow(x)
+        site.ind <- seq_len(nrow(x))[site.ind]
+    if (is.null(sp.ind))
+        sp.ind <- seq_len(ncol(x))
+    if (is.null(site.ind))
+        site.ind <- seq_len(nrow(x))
     if (!missing(select)) {
         if (!is.logical(select))
             select <- sort(site.ind) %in% select
@@ -65,10 +65,10 @@
     }
     sp.ind <- sp.ind[stake[sp.ind]]
     x <- x[site.ind, sp.ind]
-    if (!missing(scale)) 
+    if (!missing(scale))
         x <- coverscale(x, scale, ...)
     usedscale <- attr(x, "scale")
-    if (any(apply(x, 1, nchar) > 1)) 
+    if (any(apply(x, 1, nchar) > 1))
         stop("Cowardly refusing to use longer than 1 char symbols:\nUse scale")
     x <- as.matrix(x)
     x <- t(x)
@@ -79,8 +79,8 @@
     per.page <- page.width - sp.len - 3
     istart <- seq(1, nst, by = per.page)
     iend <- pmin(istart + per.page - 1, nst)
-    for (st in 1:length(istart)) {
-        tbl <- apply(x[, istart[st]:iend[st], drop = FALSE], 
+    for (st in seq_along(istart)) {
+        tbl <- apply(x[, istart[st]:iend[st], drop = FALSE],
                      1, paste, sep = "", collapse = "")
         names(tbl) <- NULL
         tbl <- gsub("0", zero, tbl)
@@ -88,13 +88,13 @@
         st.nam <- colnames(x)[istart[st]:iend[st]]
         nlen <- max(nchar(st.nam))
         mathead <- matrix(" ", nrow = length(st.nam), ncol = nlen)
-        for (i in 1:length(st.nam)) {
+        for (i in seq_along(st.nam)) {
             tmp <- unlist(strsplit(st.nam[i], NULL))
             start <- nlen - length(tmp) + 1
             mathead[i, start:nlen] <- tmp
         }
         head <- cbind(apply(mathead, 2, paste, sep = "", collapse = ""))
-        tbl <- rbind(cbind(matrix(" ", nrow = nrow(head), 1), 
+        tbl <- rbind(cbind(matrix(" ", nrow = nrow(head), 1),
                            head), tbl)
         d <- list()
         l <- 0
diff --git a/build/vignette.rds b/build/vignette.rds
index 891f9d5..54c0910 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd
index a1d980a..939ca1b 100644
--- a/inst/NEWS.Rd
+++ b/inst/NEWS.Rd
@@ -2,6 +2,115 @@
 \title{vegan News}
 \encoding{UTF-8}
 
+\section{Changes in version 2.3-0}{
+
+  \subsection{BUG FIXES}{
+    \itemize{
+
+      \item Constrained ordination functions \code{cca}, \code{rda} and
+      \code{capscale} are now more robust. Scoping of data set names and
+      variable names is much improved. This should fix numerous
+      long-standing problems, for instance those reported by Benedicte
+      Bachelot (in email) and Richard Telford (in Twitter), as well as
+      issues \href{https://github.com/vegandevs/vegan/issues/16}{#16}
+      and \href{https://github.com/vegandevs/vegan/issues/100}{#100} in
+      GitHub.
+
+      \item Ordination functions \code{cca} and \code{rda} silently
+      accepted dissimilarities as input although their analysis makes
+      no sense with these methods. Dissimilarities should be analysed
+      with distance-based redundancy analysis (\code{capscale}).
+
+      \item The variance of the conditional component was over-estimated
+      in \code{goodness} of \code{rda} results, and results were wrong
+      for partial RDA. The problems were reported in an
+      \href{https://stat.ethz.ch/pipermail/r-sig-ecology/2015-March/004936.html}{R-sig-ecology}
+      message by Christoph von Redwitz.
+
+    }
+  } % bug fixes
+
+  \subsection{WINDOWS}{
+    \itemize{
+
+      \item \code{orditkplot} did not add file type identifier to saved
+      graphics in Windows although that is required. The problem only
+      concerned Windows OS.
+
+    }
+  } % windows
+
+  \subsection{NEW FEATURES AND FUNCTIONS}{
+    \itemize{
+
+      \item \code{goodness} function for constrained ordination
+      (\code{cca}, \code{rda}, \code{capscale}) was redesigned. Function
+      gained argument \code{addprevious} to add the variation explained
+      by previous ordination components to axes when \code{statistic =
+      "explained"}. With this option, \code{model = "CCA"} will include
+      the variation explained by partialled-out conditions, and
+      \code{model = "CA"} will include the accumulated variation
+      explained by conditions and constraints. The former behaviour was
+      \code{addprevious = TRUE} for \code{model = "CCA"}, and
+      \code{addprevious = FALSE} for \code{model = "CA"}. The argument
+      will have no effect when \code{statistic = "distance"}, but this
+      will always show the residual distance after all previous
+      components. Formerly it displayed the residual distance only for
+      the currently analysed model.
+
+      \item Functions \code{ordiArrowMul} and \code{ordiArrowTextXY} are
+      exported and can be used in normal interactive sessions. These
+      functions are used to scale a bunch arrows to fit ordination
+      graphics, and formerly they were internal functions used within
+      other \pkg{vegan} functions.
+
+      \item \code{orditkplot} can export graphics in SVG format. SVG is
+      a vector graphics format which can be edited with several external
+      programs, such as Illustrator and Inkscape.
+
+      \item Rarefaction curve (\code{rarecurve}) and species
+      accumulation models (\code{specaccum}, \code{fitspecaccum})
+      gained new functions to estimate the slope of curve at given
+      location. Originally this was based on a response to an
+      \href{https://stat.ethz.ch/pipermail/r-sig-ecology/2015-May/005038.html}{R-SIG-ecology}
+      query. For rarefaction curves, the function is \code{rareslope},
+      and for species accumulation models it is \code{specslope}.
+
+      The functions are based on analytic equations, and can also be
+      evaluated at interpolated non-integer values. In
+      \code{specaccum} models the functions can be only evaluated for
+      analytic models \code{"exact"}, \code{"rarefaction"} and
+      \code{"coleman"}. With \code{"random"} and \code{"collector"}
+      methods you can only use finite differences
+      (\code{diff(fitted(<result.object>))}). Analytic functions for
+      slope are used for all non-linear regression models known to
+      \code{fitspecaccum}.
+
+      \item Species accumulation models (\code{specaccum}) and
+      non-liner regression models for species accumulation
+      (\code{fitspecaccum}) work more consistently with weights. In
+      all cases, the models are defined using the number of sites as
+      independent variable, which with weights means that observations
+      can be non-integer numbers of virtual sites. The \code{predict}
+      models also use the number of sites with \code{newdata},
+      and for analytic models they can estimate the expected values
+      for non-integer number of sites, and for non-analytic randomized
+      or collector models they can interpolate on non-integer values.
+
+      \item \code{fitspecaccum} gained support functions \code{AIC}
+      and \code{deviance}.
+
+      \item The \code{varpart} plots of four-component models were
+      redesigned following Legendre, Borcard & Roberts \emph{Ecology}
+      93, 1234--1240 (2012), and they use now four ellipses instead of
+      three circles and two rectangles. The components are now labelled
+      in plots, and the circles and ellipses can be easily filled with
+      transparent background colour.
+
+    }
+  } % new features
+} % v2.2-2
+
 \section{Changes in version 2.2-1}{
 
   \subsection{GENERAL}{
diff --git a/inst/doc/FAQ-vegan.pdf b/inst/doc/FAQ-vegan.pdf
index d43090e..3ca9203 100644
Binary files a/inst/doc/FAQ-vegan.pdf and b/inst/doc/FAQ-vegan.pdf differ
diff --git a/inst/doc/NEWS.html b/inst/doc/NEWS.html
index c01b47f..4c59561 100644
--- a/inst/doc/NEWS.html
+++ b/inst/doc/NEWS.html
@@ -7,6 +7,133 @@
 
 <h2>vegan News</h2>
 
+<h3>Changes in version 2.3-0</h3>
+
+
+
+<h4>BUG FIXES</h4>
+
+
+<ul>
+<li><p> Constrained ordination functions <code>cca</code>, <code>rda</code> and
+<code>capscale</code> are now more robust. Scoping of data set names and
+variable names is much improved. This should fix numerous
+long-standing problems, for instance those reported by Benedicte
+Bachelot (in email) and Richard Telford (in Twitter), as well as
+issues <a href="https://github.com/vegandevs/vegan/issues/16">#16</a>
+and <a href="https://github.com/vegandevs/vegan/issues/100">#100</a> in
+GitHub.
+</p>
+</li>
+<li><p> Ordination functions <code>cca</code> and <code>rda</code> silently
+accepted dissimilarities as input although their analysis makes
+no sense with these methods. Dissimilarities should be analysed
+with distance-based redundancy analysis (<code>capscale</code>).
+</p>
+</li>
+<li><p> The variance of the conditional component was over-estimated
+in <code>goodness</code> of <code>rda</code> results, and results were wrong
+for partial RDA. The problems were reported in an
+<a href="https://stat.ethz.ch/pipermail/r-sig-ecology/2015-March/004936.html">R-sig-ecology</a>
+message by Christoph von Redwitz.
+</p>
+</li></ul>
+
+ 
+
+
+<h4>WINDOWS</h4>
+
+
+<ul>
+<li> <p><code>orditkplot</code> did not add file type identifier to saved
+graphics in Windows although that is required. The problem only
+concerned Windows OS.
+</p>
+</li></ul>
+
+ 
+
+
+<h4>NEW FEATURES AND FUNCTIONS</h4>
+
+
+<ul>
+<li> <p><code>goodness</code> function for constrained ordination
+(<code>cca</code>, <code>rda</code>, <code>capscale</code>) was redesigned. Function
+gained argument <code>addprevious</code> to add the variation explained
+by previous ordination components to axes when <code>statistic =
+      "explained"</code>. With this option, <code>model = "CCA"</code> will include
+the variation explained by partialled-out conditions, and
+<code>model = "CA"</code> will include the accumulated variation
+explained by conditions and constraints. The former behaviour was
+<code>addprevious = TRUE</code> for <code>model = "CCA"</code>, and
+<code>addprevious = FALSE</code> for <code>model = "CA"</code>. The argument
+will have no effect when <code>statistic = "distance"</code>, but this
+will always show the residual distance after all previous
+components. Formerly it displayed the residual distance only for
+the currently analysed model.
+</p>
+</li>
+<li><p> Functions <code>ordiArrowMul</code> and <code>ordiArrowTextXY</code> are
+exported and can be used in normal interactive sessions. These
+functions are used to scale a bunch arrows to fit ordination
+graphics, and formerly they were internal functions used within
+other <span class="pkg">vegan</span> functions.
+</p>
+</li>
+<li> <p><code>orditkplot</code> can export graphics in SVG format. SVG is
+a vector graphics format which can be edited with several external
+programs, such as Illustrator and Inkscape.
+</p>
+</li>
+<li><p> Rarefaction curve (<code>rarecurve</code>) and species
+accumulation models (<code>specaccum</code>, <code>fitspecaccum</code>)
+gained new functions to estimate the slope of curve at given
+location. Originally this was based on a response to an
+<a href="https://stat.ethz.ch/pipermail/r-sig-ecology/2015-May/005038.html">R-SIG-ecology</a>
+query. For rarefaction curves, the function is <code>rareslope</code>,
+and for species accumulation models it is <code>specslope</code>.
+</p>
+<p>The functions are based on analytic equations, and can also be
+evaluated at interpolated non-integer values. In
+<code>specaccum</code> models the functions can be only evaluated for
+analytic models <code>"exact"</code>, <code>"rarefaction"</code> and
+<code>"coleman"</code>. With <code>"random"</code> and <code>"collector"</code>
+methods you can only use finite differences
+(<code>diff(fitted(<result.object>))</code>). Analytic functions for
+slope are used for all non-linear regression models known to
+<code>fitspecaccum</code>.
+</p>
+</li>
+<li><p> Species accumulation models (<code>specaccum</code>) and
+non-liner regression models for species accumulation
+(<code>fitspecaccum</code>) work more consistently with weights. In
+all cases, the models are defined using the number of sites as
+independent variable, which with weights means that observations
+can be non-integer numbers of virtual sites. The <code>predict</code>
+models also use the number of sites with <code>newdata</code>,
+and for analytic models they can estimate the expected values
+for non-integer number of sites, and for non-analytic randomized
+or collector models they can interpolate on non-integer values.
+</p>
+</li>
+<li> <p><code>fitspecaccum</code> gained support functions <code>AIC</code>
+and <code>deviance</code>.
+</p>
+</li>
+<li><p> The <code>varpart</code> plots of four-component models were
+redesigned following Legendre, Borcard & Roberts <em>Ecology</em>
+93, 1234–1240 (2012), and they use now four ellipses instead of
+three circles and two rectangles. The components are now labelled
+in plots, and the circles and ellipses can be easily filled with
+transparent background colour.
+</p>
+</li></ul>
+
+ 
+
+
 <h3>Changes in version 2.2-1</h3>
 
 
diff --git a/inst/doc/decision-vegan.pdf b/inst/doc/decision-vegan.pdf
index e6d2559..9f3877f 100644
Binary files a/inst/doc/decision-vegan.pdf and b/inst/doc/decision-vegan.pdf differ
diff --git a/inst/doc/diversity-vegan.pdf b/inst/doc/diversity-vegan.pdf
index 7ecde2f..48db583 100644
Binary files a/inst/doc/diversity-vegan.pdf and b/inst/doc/diversity-vegan.pdf differ
diff --git a/inst/doc/intro-vegan.pdf b/inst/doc/intro-vegan.pdf
index d5af1d6..fa58dd7 100644
Binary files a/inst/doc/intro-vegan.pdf and b/inst/doc/intro-vegan.pdf differ
diff --git a/man/cascadeKM.Rd b/man/cascadeKM.Rd
index 68a5404..e879f18 100644
--- a/man/cascadeKM.Rd
+++ b/man/cascadeKM.Rd
@@ -145,7 +145,7 @@ cIndexKM(y, x, index = "all")
 \references{
 
   Calinski, T. and J. Harabasz. 1974. A dendrite method for cluster
-  analysis. \emph{Commun. Stat.} \strong{3}: 1-27.
+  analysis. \emph{Commun. Stat.} \strong{3}: 1--27.
 
   Dolnicar, S., K. Grabler and J. A. Mazanec. 1999.  A tale of three
   cities: perceptual charting for analyzing destination images. Pp.
@@ -155,18 +155,18 @@ cIndexKM(y, x, index = "all")
   
   Gower, J. C. 1966. Some distance properties of latent root and vector
   methods used in multivariate analysis. \emph{Biometrika} \strong{53}:
-  325-338.
+  325--338.
   
   Legendre, P. & L. Legendre. 2012. \emph{Numerical ecology}, 3rd
   English edition. Elsevier Science BV, Amsterdam.
   
   Milligan, G. W. & M. C. Cooper. 1985. An examination of procedures for
   determining the number of clusters in a data set. \emph{Psychometrika}
-  \strong{50}: 159-179.
+  \strong{50}: 159--179.
 
-  Weingessel, A., Dimitriadou, A. and Dolnicar, S. \emph{An Examination
-  Of Indexes For Determining The Number Of Clusters In Binary Data
-  Sets}, \url{http://www.wu-wien.ac.at/am/wp99.htm#29}
+  Weingessel, A., Dimitriadou, A. and Dolnicar, S. 2002. An examination
+  of indexes for determining the number of clusters in binary data
+  sets. \emph{Psychometrika} \strong{67}: 137--160.
 }
 
 \author{ Marie-Helene Ouellette
diff --git a/man/cca.Rd b/man/cca.Rd
index ba58041..5b0a625 100644
--- a/man/cca.Rd
+++ b/man/cca.Rd
@@ -190,7 +190,7 @@
 }
 \author{
   The responsible author was Jari Oksanen, but the code borrows heavily
-  from Dave Roberts (\url{http://labdsv.nr.usu.edu/}).
+  from Dave Roberts (Montana State University, USA).
 }
 
 \seealso{
diff --git a/man/diversity.Rd b/man/diversity.Rd
index 588d8cb..5fdeb21 100644
--- a/man/diversity.Rd
+++ b/man/diversity.Rd
@@ -5,6 +5,7 @@
 \alias{rrarefy}
 \alias{drarefy}
 \alias{rarecurve}
+\alias{rareslope}
 \alias{fisher.alpha}
 \alias{specnumber}
 
@@ -20,6 +21,7 @@ rrarefy(x, sample)
 drarefy(x, sample)
 rarecurve(x, step = 1, sample, xlab = "Sample Size", ylab = "Species",
           label = TRUE, col, lty, ...)
+rareslope(x, sample)
 fisher.alpha(x, MARGIN = 1, ...)
 specnumber(x, groups, MARGIN = 1)
 }
@@ -60,9 +62,9 @@ specnumber(x, groups, MARGIN = 1)
   Function \code{rarefy} gives the expected species richness in random
   subsamples of size \code{sample} from the community. The size of
   \code{sample} should be smaller than total community size, but the
-  function will silently work for larger \code{sample} as well and
-  return non-rarefied species richness (and standard error = 0). If
-  \code{sample} is a vector, rarefaction of all observations is
+  function will work for larger \code{sample} as well (with a warning)
+  and return non-rarefied species richness (and standard error =
+  0). If \code{sample} is a vector, rarefaction of all observations is
   performed for each sample size separately.  Rarefaction can be
   performed only with genuine counts of individuals.  The function
   \code{rarefy} is based on Hurlbert's (1971) formulation, and the
@@ -87,6 +89,10 @@ specnumber(x, groups, MARGIN = 1)
   drawn at \code{sample} with horizontal lines for the rarefied
   species richnesses.
 
+  Function \code{rareslope} calculates the slope of \code{rarecurve}
+  (derivative of \code{rarefy}) at given \code{sample} size; the
+  \code{sample} need not be an integer.
+
   \code{fisher.alpha} estimates the \eqn{\alpha} parameter of
   Fisher's logarithmic series (see \code{\link{fisherfit}}). 
   The estimation is possible only for genuine
diff --git a/man/envfit.Rd b/man/envfit.Rd
index 07e6677..aca9642 100644
--- a/man/envfit.Rd
+++ b/man/envfit.Rd
@@ -47,8 +47,15 @@ factorfit(X, P, permutations = 0, strata = NULL, w, ...)
     or environmental variables. The operation is casewise: the whole
     row of data is removed if there is a missing value and 
     \code{na.rm = TRUE}.}
-  \item{x}{A result object from \code{envfit}.}
+    
+  \item{x}{A result object from \code{envfit}. For \code{ordiArrowMul}
+    and \code{ordiArrowTextXY} this must be a two-column matrix (or
+    matrix-like object) containing the coordinates of arrow heads on
+    the two plot axes, and other methods extract such a structure from
+    the \code{envfit} results.}
+    
   \item{choices}{Axes to plotted.}
+    
   \item{labels}{Change plotting labels. The argument should be a list
     with elements \code{vectors} and \code{factors} which give the new
     plotting labels. If either of these elements is omitted, the
@@ -82,6 +89,7 @@ factorfit(X, P, permutations = 0, strata = NULL, w, ...)
     (with synonyms \code{"bp"} or \code{"cn"}, resp.).}
   \item{w}{Weights used in fitting (concerns mainly \code{\link{cca}}
     and \code{\link{decorana}} results which have nonconstant weights).}
+
   \item{...}{Parameters passed to \code{\link{scores}}.}
 }
 \details{
@@ -110,7 +118,7 @@ factorfit(X, P, permutations = 0, strata = NULL, w, ...)
   adjusted to the current graph using a constant multiplier: this will
   keep the relative \code{r2}-scaled lengths of the arrows but tries
   to fill the current plot.  You can see the multiplier using
-  \code{vegan:::ordiArrowMul(result_of_envfit)}, and set it with the
+  \code{ordiArrowMul(result_of_envfit)}, and set it with the
   argument \code{arrow.mul}.
   
   Functions \code{vectorfit} and \code{factorfit} can be called directly.
@@ -146,8 +154,9 @@ factorfit(X, P, permutations = 0, strata = NULL, w, ...)
   for the physical size of the plot, and the arrow lengths cannot be
   compared across plots. For similar scaling of arrows, you must
   explicitly set the \code{arrow.mul} argument in the \code{plot}
-  command.
-
+  command; see \code{\link{ordiArrowMul}} and
+  \code{\link{ordiArrowTextXY}}.
+  
   The results can be accessed with \code{scores.envfit} function which
   returns either the fitted vectors scaled by correlation coefficient or
   the centroids of the fitted environmental variables.
@@ -210,6 +219,7 @@ ord <- cca(varespec ~ Al + P + K, varechem)
 plot(ord, type="p")
 fit <- envfit(ord, varechem, perm = 999, display = "lc")
 plot(fit, p.max = 0.05, col = "red")
+
 ## Class variables, formula interface, and displaying the
 ## inter-class variability with `ordispider', and semitransparent
 ## white background for labels (semitransparent colours are not
@@ -228,6 +238,7 @@ labels(fit)
 plot(ord)
 plot(fit, labels=list(factors = paste("M", c(1,2,4,5), sep = "")),
    bg = rgb(1,1,0,0.5))
+detach(dune.env)
 }
 \keyword{multivariate }
 \keyword{aplot}
diff --git a/man/goodness.cca.Rd b/man/goodness.cca.Rd
index 398cfe0..c238605 100644
--- a/man/goodness.cca.Rd
+++ b/man/goodness.cca.Rd
@@ -1,6 +1,5 @@
 \name{goodness.cca}
 \alias{goodness}
-\alias{goodness.rda}
 \alias{goodness.cca}
 \alias{inertcomp}
 \alias{spenvcor}
@@ -21,7 +20,7 @@
 \usage{
 \method{goodness}{cca}(object, display = c("species", "sites"), choices,
     model = c("CCA", "CA"), statistic = c("explained", "distance"),
-    summarize = FALSE, ...)
+    summarize = FALSE, addprevious = FALSE, ...)
 inertcomp(object, display = c("species", "sites"),
     statistic = c("explained", "distance"), proportional = FALSE)
 spenvcor(object)
@@ -33,15 +32,31 @@ vif.cca(object)
 \arguments{
   \item{object}{A result object from \code{\link{cca}},
     \code{\link{rda}} or \code{\link{capscale}}. }
-  \item{display}{Display \code{"species"} or \code{"sites"}. }
-  \item{choices}{Axes shown. Default is to show all axes of the \code{"model"}. }
+
+  \item{display}{Display \code{"species"} or \code{"sites"}. Species
+    are not available in \code{\link{capscale}}. }
+
+  \item{choices}{Axes shown. Default is to show all axes of the
+    \code{"model"}. }
+
   \item{model}{Show constrained (\code{"CCA"}) or unconstrained
     (\code{"CA"}) results. }
+
   \item{statistic}{Statistic used: \code{"explained"} gives the cumulative
-  percentage accounted for, \code{"distance"} shows the residual
-  distances. Distances are not available for sites in constrained or
-  partial analyses. }
-  \item{summarize}{Show only the accumulated total. }
+    percentage accounted for, \code{"distance"} shows the residual
+    distances. }
+
+  \item{summarize}{Show only the accumulated total.}
+
+  \item{addprevious}{Add the variation explained by previous components
+     when \code{statistic="explained"}. For \code{model="CCA"} add
+     conditionened (partialled out) variation, and for \code{model="CA"}
+     add both conditioned and constrained variation. This will give
+     cumulative explanation. The argument has no effect when
+     \code{statistic="distance"}, but this will always show the residual
+     distance after current axis and all previous components.
+   }
+
   \item{proportional}{Give the inertia components as proportional for
     the corresponding total.}
   \item{names.only}{Return only names of aliased variable(s) instead of
@@ -51,9 +66,8 @@ vif.cca(object)
 \details{
   Function \code{goodness} gives the diagnostic statistics for species
   or sites. The alternative statistics are the cumulative proportion of
-  inertia accounted for by the axes, and the residual distance left
-  unaccounted for.  The conditional (\dQuote{partialled out}) constraints are
-  always regarded as explained and included in the statistics.
+  inertia accounted for up to the axes, and the residual distance left
+  unaccounted for.
 
   Function \code{inertcomp} decomposes the inertia into partial,
   constrained and unconstrained components for each site or
@@ -115,12 +129,6 @@ vif.cca(object)
   total inertia is not a meaningful concept in \code{cca}, in particular
   for rare species.
 
-  Function \code{vif} is defined as generic in package \pkg{car}
-  (\code{\link[car]{vif}}), but if you have not loaded that package
-  you must specify the call as \code{vif.cca}.  Variance inflation
-  factor is useful diagnostic tool for  detecting nearly collinear
-  constraints, but these are not a problem with algorithm used in this
-  package to fit a constrained ordination.
 }
 
 \seealso{\code{\link{cca}}, \code{\link{rda}}, \code{\link{capscale}},
@@ -129,8 +137,8 @@ vif.cca(object)
 data(dune)
 data(dune.env)
 mod <- cca(dune ~ A1 + Management + Condition(Moisture), data=dune.env)
-goodness(mod)
-goodness(mod, summ = TRUE)
+goodness(mod, addprevious = TRUE)
+goodness(mod, addprevious = TRUE, summ = TRUE)
 # Inertia components
 inertcomp(mod, prop = TRUE)
 inertcomp(mod, stat="d")
diff --git a/man/oecosimu.Rd b/man/oecosimu.Rd
index 6d3f640..5790ef2 100644
--- a/man/oecosimu.Rd
+++ b/man/oecosimu.Rd
@@ -177,8 +177,8 @@ oecosimu(comm, nestfun, method, nsimul = 99, burnin = 0, thin = 1,
   \item{statistic}{Observed values of the statistic.}
   \item{simulated}{Simulated values of the statistic.}
   \item{means}{Mean values of the statistic from simulations.}
-  \item{z}{\eqn{z}-values or the standardized effect sizes of the observed 
-     statistic based on simulations.}
+  \item{z}{Standardized effect sizes (SES, a.k.a. the \eqn{z}-values)
+     of the observed statistic based on simulations.}
   \item{pval}{The \eqn{P}-values of the statistic based on simulations.}
   \item{alternative}{The type of testing as given in argument \code{alternative}.}
   \item{method}{The \code{method} used in \code{\link{nullmodel}}.}
diff --git a/man/ordiArrowTextXY.Rd b/man/ordiArrowTextXY.Rd
new file mode 100644
index 0000000..fb661ef
--- /dev/null
+++ b/man/ordiArrowTextXY.Rd
@@ -0,0 +1,109 @@
+\name{ordiArrowTextXY}
+\alias{ordiArrowMul}
+\alias{ordiArrowTextXY}
+
+\title{Support Functions for Drawing Vectors}
+\description{
+  Support functions to assist with drawing of vectors (arrows) on
+  ordination plots. \code{ordiArrowMul} finds the multiplier for the
+  coordinates of the head of the vector such that they accupy
+  \code{fill} proportion of the plot region. \code{ordiArrowTextXY}
+  finds coordinates for the locations of \code{labels} to be drawn just
+  beyond the head of the vector.
+}
+\usage{
+ordiArrowTextXY(x, labels, display, choices = c(1,2),
+                rescale = TRUE, fill = 0.75, \ldots)
+ordiArrowMul(x, at = c(0,0), fill = 0.75,
+             display, choices = c(1,2), \ldots)
+}
+
+\arguments{
+  \item{x}{An R object, from which \code{\link{scores}} can determine
+    suitable ordination scores or an object created by
+    \code{\link{envfit}}, or a two-column matrix of coordinates of arrow
+    heads on the two plot axes.}
+    
+  \item{labels}{Change plotting labels. A character vector of labels for
+    which label coordinates are sought. If not supplied, these will be
+    determined from the row names of \code{x}, or \code{scores(x, ...)}
+    if required. If either of these are not defined, suitable labels
+    will be generated.}
+  
+  \item{display}{a character string known to \code{\link{scores}} or one
+    of its methods which indicates the type of scores to extract. In
+    fitting functions these are ordinary site scores or linear
+    combination scores (\code{"lc"}) in constrained ordination
+    (\code{\link{cca}}, \code{\link{rda}}, \code{\link{capscale}}). If
+    \code{x} was created by \code{envfit} then \code{display} can not be
+    set by the user and takes the value \code{"vectors"}. Ignored if
+    \code{x} is a matrix.}
+    
+  \item{choices}{Axes to be plotted.}
+
+  \item{rescale}{logical; should the coordinates in or extracted from
+    \code{x} be rescaled to fill \code{fill} proportion of the plot
+    region? The default is to always rescale the coordinates as this is
+    usually desired for objects \code{x} from which coordinates are
+    retrieved. If supplying \code{x} a 2-column matrix that has already
+    been rescaled, then set this to \code{FALSE}.}
+    
+  \item{fill}{numeric; the proportion of the plot to fill by the span of
+    the arrows.}
+  
+  \item{at}{The origin of fitted arrows in the plot.  If you plot arrows
+    in other places than origin, you probably have to specify
+    \code{arrrow.mul}.}
+  
+  \item{...}{Parameters passed to \code{\link{scores}}, and
+    \code{\link{strwidth}} and \code{\link{strheight}}.}
+}
+
+\details{
+  \code{ordiArrowMul} finds a multiplier to scale a bunch of
+  arrows to fill an ordination plot, and \code{ordiArrowTextXY} finds
+  the coordinates for labels of these arrows. NB.,
+  \code{ordiArrowTextXY} does not draw labels; it simply returns
+  coordinates at which the labels should be drawn for use with another
+  function, such as \code{\link{text}}.
+}
+
+\value{
+  For \code{ordiArrowTextXY}, a 2-column matrix of coordinates for the
+  label centres in the coordinate system of the currently active
+  plotting device.
+
+  For \code{ordiArrowMul}, a length-1 vector containing the scaling
+  factor.
+}
+
+\author{Jari Oksanen, with modifications by Gavin L. Simpson}
+
+\examples{
+    ## Scale arrows by hand to fill 80% of the plot
+    ## Biplot arrows by hand
+    data(varespec, varechem)
+    ord <- cca(varespec ~ Al + P + K, varechem)
+    plot(ord, display = c("species","sites"))
+
+    ## biplot scores
+    bip <- scores(ord, choices = 1:2, display = "bp")
+
+    ## scaling factor for arrows to fill 80% of plot
+    (mul <- ordiArrowMul(bip, fill = 0.8))
+    bip.scl <- bip * mul                    # Scale the biplot scores
+    labs <- rownames(bip)                   # Arrow labels
+
+    ## calculate coordinate of labels for arrows
+    (bip.lab <- ordiArrowTextXY(bip.scl, rescale = FALSE, labels = labs))
+
+    ## draw arrows and text labels
+    arrows(0, 0, bip.scl[,1], bip.scl[,2], length = 0.1)
+    text(bip.lab, labels = labs)
+
+    ## Handling of ordination objects directly
+    mul2 <- ordiArrowMul(ord, display = "bp", fill = 0.8)
+    stopifnot(all.equal(mul, mul2))
+}
+
+\keyword{utilities}
\ No newline at end of file
diff --git a/man/ordiarrows.Rd b/man/ordiarrows.Rd
index 6ae620b..2d0052e 100644
--- a/man/ordiarrows.Rd
+++ b/man/ordiarrows.Rd
@@ -56,18 +56,20 @@ ordigrid(ord, levels, replicates, display = "sites",  lty = c(1,1),
 
   \item{\dots}{Parameters passed to graphical functions such as
     \code{\link{lines}}, \code{\link{segments}}, \code{\link{arrows}},
-    or to \code{\link{scores}} to select axes and scaling etc. } 
+    or to \code{\link{scores}} to select axes and scaling etc. }
 }
 
 \details{ Function \code{ordiarrows} draws \code{\link{arrows}} and
   \code{ordisegments} draws line \code{\link{segments}} between
   successive items in the groups. Function \code{ordigrid} draws line
   \code{\link{segments}} both within the groups and for the
-  corresponding items among the groups.  }
+  corresponding items among the groups.
+
+}
 
 \note{These functions add graphical items to ordination graph: You must
   draw a graph first.
-  }
+}
 \author{ Jari Oksanen }
 
 \seealso{The functions pass parameters to basic graphical functions, and
diff --git a/man/orditkplot.Rd b/man/orditkplot.Rd
index e3a4b89..3410ef1 100644
--- a/man/orditkplot.Rd
+++ b/man/orditkplot.Rd
@@ -69,27 +69,26 @@ orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim,
     passed to the new plot).
   }
 
-  In addition there are buttons
-  for the following tasks: \strong{Copy to EPS} copies the current plot
-  to an encapsulated postscript (eps) file using standard Tcl/Tk
-  utilities. The faithfulness of this copy is system dependent. Button
-  \strong{Export plot} uses \code{plot.orditkplot} function to redraw
-  the plot into graphical file formats. Depending on the system, the
-  following graphical formats may be available: eps, pdf, png, jpeg or
-  bmp. The file type is deduced from the file suffix or the selection of
-  the file type in the dialogue box. Alternatively, the same dialogue can be
-  used to save the plot to an editable \code{\link{xfig}} file. Button
-  \strong{Dump to R} writes the edited coordinates of labels and points
-  to the \R session for further processing, and the
-  \code{plot.orditkplot} function can be used to display the
-  results. For faithful replication of the plot, the graph must have
-  similar dimensions as the \code{orditkplot} canvas had originally. The
-  \code{plot} function cannot be configured, but it uses the same
-  settings as the original Tcl/Tk plot. However, \code{points} and
-  \code{text} functions are fully configurable, and unaware of the
-  original Tcl/Tk plot settings (probably you must set \code{cex} at
-  least to get a decent plot). Finally, button \strong{Dismiss} closes
-  the window.
+  In addition there are buttons for the following tasks: \strong{Copy
+  to EPS} copies the current plot to an encapsulated postscript (eps)
+  file using standard Tcl/Tk utilities. The faithfulness of this copy
+  is system dependent. Button \strong{Export plot} uses
+  \code{plot.orditkplot} function to redraw the plot into graphical
+  file formats. Depending on the system, the following graphical
+  formats may be available: eps, pdf, svg, png, jpeg, tiff, bmp or
+  xfig. Some of the output formats may be edited with external
+  software: svg files with Illustrator or Inkscape, and xfig with the
+  legacy program XFig. Button \strong{Dump to R} writes the edited
+  coordinates of labels and points to the \R session for further
+  processing, and the \code{plot.orditkplot} function can be used to
+  display the results. For faithful replication of the plot, the graph
+  must have similar dimensions as the \code{orditkplot} canvas had
+  originally. The \code{plot} function cannot be configured, but it
+  uses the same settings as the original Tcl/Tk plot. However,
+  \code{points} and \code{text} functions are fully configurable, and
+  unaware of the original Tcl/Tk plot settings (probably you must set
+  \code{cex} at least to get a decent plot). Finally, button
+  \strong{Dismiss} closes the window.
 
   The produced plot will have equal aspect ratio. The width of the
   horizontal axis is fixed, but vertical axes will be scaled to needed
diff --git a/man/permustats.Rd b/man/permustats.Rd
index 403d3d5..22990e8 100644
--- a/man/permustats.Rd
+++ b/man/permustats.Rd
@@ -57,16 +57,16 @@ permustats(x, ...)
   observed statistics from several \pkg{vegan} functions that perform
   permutations or simulations.  
 
-  The \code{summary} method of \code{permustats} estimates the \eqn{z}
-  values, also known as standardized effect sizes (SES) as the
-  difference of observed statistic and mean of permutations divided by
-  the standard deviation of permutations. It also prints the the mean,
-  median, and limits which contain \code{interval} percent of permuted
-  values. With the default (\code{interval = 0.95}), for two-sided test
-  these are (2.5\%, 97.5\%) and for one-sided tests either 5\% or 95\%
-  quantile depending on the test direction. The mean, quantiles and
-  \eqn{z} values are evaluated from permuted values without observed
-  statistic.
+  The \code{summary} method of \code{permustats} estimates the
+  standardized effect sizes (SES) as the difference of observed
+  statistic and mean of permutations divided by the standard deviation
+  of permutations (also known as \eqn{z}-values). It also prints the
+  the mean, median, and limits which contain \code{interval} percent
+  of permuted values. With the default (\code{interval = 0.95}), for
+  two-sided test these are (2.5\%, 97.5\%) and for one-sided tests
+  either 5\% or 95\% quantile depending on the test direction. The
+  mean, quantiles and \eqn{z} values are evaluated from permuted
+  values without observed statistic.
 
   The \code{density} and \code{densityplot} methods display the
   kernel density estimates of permuted values. When observed value of
diff --git a/man/procrustes.Rd b/man/procrustes.Rd
index 632125d..193defb 100644
--- a/man/procrustes.Rd
+++ b/man/procrustes.Rd
@@ -131,7 +131,7 @@ protest(X, Y, scores = "sites", permutations = how(nperm = 999), ...)
   function). Function \code{predict} can be used to add new rotated
   coordinates to the target. The \code{predict} function will always
   translate coordinates to the original non-centred matrix. The
-  function canot be used with \code{newdata} for \code{symmetric}
+  function cannot be used with \code{newdata} for \code{symmetric}
   analysis.
 
   Function \code{protest} performs symmetric Procrustes analysis
diff --git a/man/sipoo.Rd b/man/sipoo.Rd
index 476321d..f59e9b6 100644
--- a/man/sipoo.Rd
+++ b/man/sipoo.Rd
@@ -15,10 +15,8 @@ oceanic distinction unclear from source).
   these unique). The example gives the areas of the studies islands in
   hectares. 
 }
+
 \source{
-\url{http://www.aics-research.com/nested/}
-}
-\references{
 Simberloff, D. & Martin, J.-L.  (1991). 
 Nestedness of insular avifaunas:
 simple summary statistics masking
diff --git a/man/specaccum.Rd b/man/specaccum.Rd
index 55c5309..00ed7b8 100644
--- a/man/specaccum.Rd
+++ b/man/specaccum.Rd
@@ -10,6 +10,9 @@
 \alias{lines.fitspecaccum}
 \alias{predict.specaccum}
 \alias{predict.fitspecaccum}
+\alias{AIC.fitspecaccum}
+\alias{deviance.fitspecaccum}
+\alias{specslope}
 
 \title{Species Accumulation Curves }
 \description{
@@ -30,6 +33,7 @@ fitspecaccum(object, model, method = "random", ...)
     ylab = x$method, ...) 
 \method{predict}{specaccum}(object, newdata, interpolation = c("linear", "spline"), ...)
 \method{predict}{fitspecaccum}(object, newdata, ...)
+specslope(object, at)
 }
 
 \arguments{
@@ -57,7 +61,8 @@ fitspecaccum(object, model, method = "random", ...)
     values are taken as \code{FALSE}.}
   \item{x}{A \code{specaccum} result object}
   \item{add}{Add to an existing graph.}
-  \item{random}{\dots}
+  \item{random}{Draw each random simulation separately instead of
+    drawing their average and confidence intervals.}
   \item{ci}{Multiplier used to get confidence intervals from standard
     deviation (standard error of the estimate). Value \code{ci = 0}
     suppresses drawing confidence intervals.}
@@ -85,6 +90,9 @@ fitspecaccum(object, model, method = "random", ...)
   
   \item{interpolation}{Interpolation method used with \code{newdata}.}
 
+  \item{at}{Number of plots where the slope is evaluated. Can be a
+    real number.}
+
   \item{...}{Other parameters to functions.}
 }
 \details{
@@ -108,9 +116,10 @@ fitspecaccum(object, model, method = "random", ...)
   deviation following Coleman et al. (1982).  All these methods are
   based on sampling sites without replacement. In contrast, the
   \code{method = "rarefaction"} finds the expected species richness and
-  its standard deviation by sampling individuals instead of sites. It
-  achieves this by applying function \code{\link{rarefy}} with number of individuals
-  corresponding to average number of individuals per site.
+  its standard deviation by sampling individuals instead of sites.
+  It achieves this by applying function \code{\link{rarefy}} with
+  number of individuals corresponding to average number of individuals
+  per site.
 
   Methods \code{"random"} and \code{"collector"} can take weights
   (\code{w}) that give the sampling effort for each site.  The weights
@@ -135,13 +144,16 @@ fitspecaccum(object, model, method = "random", ...)
   The \code{summary} and \code{boxplot} methods are available for
   \code{method = "random"}.
 
-  Function \code{predict} can return the values corresponding to
-  \code{newdata} using linear (\code{\link{approx}}) or spline
-  (\code{\link{spline}}) interpolation. The function cannot
-  extrapolate with linear interpolation, and with spline the type and
-  sensibility of the extrapolation depends on argument \code{method}
-  which is passed to \code{\link{spline}}.  If \code{newdata} is not
-  given, the function returns the values corresponding to the data.
+  Function \code{predict} for \code{specaccum} can return the values
+  corresponding to \code{newdata}. With \code{method} \code{"exact"},
+  \code{"rarefaction"} and \code{"coleman"} the function uses analytic
+  equations for interpolated non-integer values, and for other methods
+  linear (\code{\link{approx}}) or spline (\code{\link{spline}})
+  interpolation. If \code{newdata} is not given, the function returns
+  the values corresponding to the data. NB., the fitted values with
+  \code{method="rarefaction"} are based on rounded integer counts, but
+  \code{predict} can use fractional non-integer counts with
+  \code{newdata} and give slightly different results.
 
   Function \code{fitspecaccum} fits a nonlinear (\code{\link{nls}})
   self-starting species accumulation model. The input \code{object}
@@ -166,9 +178,18 @@ fitspecaccum(object, model, method = "random", ...)
   individuals.  The \code{plot} is still based on sites, unless other
   alternative is selected with \code{xvar}.
 
-  Function \code{predict} uses \code{\link{predict.nls}}, and you can
-  pass all arguments to that function. In addition, \code{fitted},
-  \code{residuals} and \code{coef} work on the result object.
+  Function \code{predict} for \code{fitspecaccum} uses
+  \code{\link{predict.nls}}, and you can pass all arguments to that
+  function. In addition, \code{fitted}, \code{residuals} and
+  \code{coef}, \code{AIC} and \code{deviance} work on the result
+  object.
+
+  Function \code{specslope} evaluates the derivative of the species
+  accumulation curve at given number of sample plots, and gives the
+  rate of increase in the number of species. The function works with
+  \code{specaccum} result object when this is based on analytic models
+  \code{"exact"}, \code{"rarefaction"} or \code{"coleman"}, and with
+  non-linear regression results of \code{fitspecaccum}.
 
   Nonlinear regression may fail for any reason, and some of the
   \code{fitspecaccum} models are fragile and may not succeed.  
diff --git a/man/varpart.Rd b/man/varpart.Rd
index 18629fb..deef977 100644
--- a/man/varpart.Rd
+++ b/man/varpart.Rd
@@ -21,7 +21,8 @@
 
 \usage{
 varpart(Y, X, ..., data, transfo, scale = FALSE)
-showvarparts(parts, labels, ...)
+showvarparts(parts, labels, bg = NULL, alpha = 63, Xnames,
+    id.size = 1.2,  ...)
 \method{plot}{varpart234}(x, cutoff = 0, digits = 1, ...)
 }
 
@@ -53,6 +54,21 @@ table. }
 \item{parts}{Number of explanatory tables (circles) displayed.}
 \item{labels}{Labels used for displayed fractions. Default is to use
   the same letters as in the printed output.}
+\item{bg}{Fill colours of circles or ellipses.}
+\item{alpha}{Transparency of the fill colour.  The argument takes
+    precedence over possible transparency definitions of the
+    colour. The value must be in range \eqn{0...255}, and low values
+    are more transparent.  Transparency is not available in all
+    graphics devices or file formats.}
+  
+\item{Xnames}{Names for sources of variation. Default names are \code{X1},
+  \code{X2}, \code{X3} and \code{X4}. \code{Xnames=NA},
+  \code{Xnames=NULL} and \code{Xnames=""} produce no names. The names
+  can be changed to other names. Use short names. }
+
+\item{id.size}{A numerical value giving the character expansion factor
+  for the names of circles or ellipses. }
+
 \item{x}{The \code{varpart} result.}
 \item{cutoff}{The values below \code{cutoff} will not be displayed.}
 \item{digits}{The number of significant digits; the number of decimal
@@ -113,10 +129,17 @@ table. }
   \code{[n]}, and the joint fraction between all four tables is
   \code{[o]}.
 
-  There is a \code{plot} function that displays the Venn
-  diagram and labels each intersection (individual fraction) with the
-  adjusted R squared if this is higher than \code{cutoff}.  A helper
-  function \code{showvarpart} displays the fraction labels.
+  There is a \code{plot} function that displays the Venn diagram and
+  labels each intersection (individual fraction) with the adjusted R
+  squared if this is higher than \code{cutoff}.  A helper function
+  \code{showvarpart} displays the fraction labels. The circles and
+  ellipses are labelled by short default names or by names defined by
+  the user in argument \code{Xnames}. Longer explanatory file names can
+  be written on the varpart output plot as follows: use option
+  \code{Xnames=NA}, then add new names using the \code{text} function. A
+  bit of fiddling with coordinates (see \code{\link{locator}}) and
+  character size should allow users to place names of reasonably short
+  lengths on the \code{varpart} plot.
   
 }
 
@@ -239,11 +262,9 @@ vegandocs("partition")
 mod <- varpart(mite, ~ ., mite.pcnm, data=mite.env, transfo="hel")
 mod
 
-## argument 'bg' is passed to circle drawing, and the following
-## defines semitransparent colours
-col2 <- rgb(c(1,1),c(1,0), c(0,1), 0.3)
-showvarparts(2, bg = col2)
-plot(mod, bg = col2)
+## Use fill colours
+showvarparts(2, bg = c("hotpink","skyblue"))
+plot(mod, bg = c("hotpink","skyblue"))
 # Alternative way of to conduct this partitioning
 # Change the data frame with factors into numeric model matrix
 mm <- model.matrix(~ SubsDens + WatrCont + Substrate + Shrub + Topo, mite.env)[,-1]
@@ -258,8 +279,8 @@ RsquareAdj(aFrac)
 mod <- varpart(mite, ~ SubsDens + WatrCont, ~ Substrate + Shrub + Topo,
    mite.pcnm, data=mite.env, transfo="hel")
 mod
-showvarparts(3)
-plot(mod)
+showvarparts(3, bg=2:4)
+plot(mod, bg=2:4)
 # An alternative formulation of the previous model using
 # matrices mm1 amd mm2 and Hellinger transformed species data
 mm1 <- model.matrix(~ SubsDens + WatrCont, mite.env)[,-1]
@@ -276,9 +297,9 @@ anova(rda.result, step=200, perm.max=200)
 mod <- varpart(mite, ~ SubsDens + WatrCont, ~Substrate + Shrub + Topo,
   mite.pcnm[,1:11], mite.pcnm[,12:22], data=mite.env, transfo="hel")
 mod
-plot(mod)
+plot(mod, bg=2:5)
 # Show values for all partitions by putting 'cutoff' low enough:
-plot(mod, cutoff = -Inf, cex = 0.7)
+plot(mod, cutoff = -Inf, cex = 0.7, bg=2:5)
 }
 
 \keyword{ multivariate }
diff --git a/man/vegan-internal.Rd b/man/vegan-internal.Rd
index 95b7ba1..34ae300 100644
--- a/man/vegan-internal.Rd
+++ b/man/vegan-internal.Rd
@@ -8,8 +8,6 @@
 \alias{centroids.cca}
 \alias{ordiTerminfo}
 \alias{pasteCall}
-\alias{ordiArrowMul}
-\alias{oridArrowTextXY}
 \alias{ordiArgAbsorber}
 \alias{veganCovEllipse}
 \alias{hierParseFormula}
@@ -23,13 +21,11 @@
 }
 \usage{
 ordiGetData(call, env)
-ordiParseFormula(formula, data, xlev = NULL, envdepth = 2, 
-   na.action = na.fail, subset = NULL)
+ordiParseFormula(formula, data, xlev = NULL,  na.action = na.fail,
+    subset = NULL)
 ordiTerminfo(d, data)
 ordiNAexclude(x, excluded)
 ordiNApredict(omit, x)
-ordiArrowMul(x, at = c(0,0), fill = 0.75)
-ordiArrowTextXY(vect, labels, ...)
 ordiArgAbsorber(..., shrink, origin, scaling, triangular,
                 display, choices, const, FUN)
 centroids.cca(x, mf, wt)
@@ -54,25 +50,15 @@ hierParseFormula(formula, data)
   matrices (dependent variables, and \code{\link{model.matrix}} of
   constraints and conditions, possibly \code{NULL}) needed in
   constrained ordination. Argument \code{xlev} is passed to
-  \code{\link{model.frame}} and argument \code{envdepth} specifies the
-  depth at which the community data (dependent data) are evaluated;
-  default \code{envdepth = 2} evaluates that in the environment of the
-  parent of the calling function, and \code{envdepth = 1} within the
-  calling function (see
-  \code{\link{eval.parent}}). \code{ordiTermInfo} finds the term
+  \code{\link{model.frame}}. \code{ordiTermInfo} finds the term
   information for constrained ordination as described in
   \code{\link{cca.object}}. \code{ordiNAexclude} implements
   \code{na.action = na.exclude} for constrained ordination finding WA
   scores of CCA components and site scores of unconstrained component
   from \code{excluded} rows of observations. Function
-  \code{ordiNApredict} puts pads the result object with these or with
+  \code{ordiNApredict} pads the result object with these or with
   WA scores similarly as \code{\link{napredict}}.
 
-  \code{ordiArrowMul} finds a multiplier to scale a bunch of arrows to
-  fill an ordination plot, and \code{ordiArrowTextXY} finds the
-  coordinates for labels of these arrows.  See \code{\link{envfit}}
-  for an application.
-
   \code{ordiArgAbsorber} absorbs arguments of \code{\link{scores}}
   function of \pkg{vegan} so that these do not cause superfluous
   warnings in graphical function \code{FUN}. If you implement
diff --git a/man/vegan-package.Rd b/man/vegan-package.Rd
index 68ff79f..a5ba941 100644
--- a/man/vegan-package.Rd
+++ b/man/vegan-package.Rd
@@ -23,11 +23,9 @@ comprehensive package, and several other packages complement
 fields. Package \pkg{BiodiversityR} provides a GUI for a large subset
 of \pkg{vegan} functionality.
 
-The \pkg{vegan} package is developed at R-Forge
-(\url{http://vegan.r-forge.r-project.org}).  The R-Forge provides
-up-to-date information and mailing lists for help queries and bug
-reports. Bug reports can also be emailed to the function authors or to
-the package maintainers.
+The \pkg{vegan} package is developed at GitHub
+(\url{https://github.com/vegandevs/vegan/}).  GitHub provides up-to-date
+information and forums for bug reports.
 
 The \pkg{vegan} documents can be read with \code{\link{vegandocs}}
 function. In addition to \code{\link{vignette}}s of basic usage, you
@@ -49,9 +47,6 @@ F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, Peter
 R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry
 H. Stevens, Helene Wagner.  Many other people have contributed to
 individual functions: see credits in function help pages.
-
-The maintainers at the R-Forge are Jari Oksanen <jari.oksanen at oulu.fi>
-and Gavin Simpson <gavin.simpson at ucl.ac.uk>.
 }
 \examples{
 ### Example 1: Unconstrained ordination
diff --git a/vignettes/FAQ-vegan.pdf b/vignettes/FAQ-vegan.pdf
index d43090e..3ca9203 100644
Binary files a/vignettes/FAQ-vegan.pdf and b/vignettes/FAQ-vegan.pdf differ
diff --git a/vignettes/FAQ-vegan.texi b/vignettes/FAQ-vegan.texi
index b5c53f5..1c962c9 100644
--- a/vignettes/FAQ-vegan.texi
+++ b/vignettes/FAQ-vegan.texi
@@ -8,7 +8,7 @@
 @setfilename FAQ- at pkg{vegan}.info
 @settitle @pkg{vegan} FAQ
 @setchapternewpage on
- at set FAQ_YEAR 2014
+ at set FAQ_YEAR 2015
 @afourpaper
 @c %**end of header
 
@@ -25,7 +25,7 @@ License. To view a copy of this license, visit
 Creative Commons, 543 Howard Street, 5th Floor, San Francisco,
 California, 94105, USA.
 
-Copyright @copyright{} 2008-2013 Jari Oksanen
+Copyright @copyright{} 2008-2015 vegan development team
 @end quotation
 @end copying
 
@@ -638,14 +638,14 @@ ordination @code{plot} command, you can see the value of the currently
 used @code{arrow.mul} which is saved as an attribute of @code{biplot}
 scores.
 
-An unexported function @code{ordiArrowMul} is used to find the scaling
-for the current plot. You can use this function to see how arrows would
-be scaled:
+Function @code{ordiArrowMul} is used to find the scaling for the
+current plot. You can use this function to see how arrows would be
+scaled:
 @example
 sol <- cca(varespec)
 ef <- envfit(sol ~ ., varechem)
 plot(sol)
-vegan:::ordiArrowMul(scores(ef, display="vectors"))
+ordiArrowMul(scores(ef, display="vectors"))
 @end example
 
 @node I want to use Helmert or sum contrasts, What are aliased variables and how to see them?, How are environmental arrows scaled?, Ordination
@@ -704,8 +704,11 @@ and characters.
 
 If there is a really high number of species or sites, the graphs often
 are congested and many labels are overwritten. It may be impossible to
-have complete readable graphics with some data sets. However, here are
-some tricks you can use:
+have complete readable graphics with some data sets. Below we give a
+brief overview of tricks you can use. Gavin Simpson's blog
+ at uref{http://www.fromthebottomoftheheap.net,, From the bottom of the
+heap} has a series of articles on ``decluttering ordination plots'' with
+more detailed discussion and examples.
 @itemize
 
 @item 
@@ -723,19 +726,25 @@ Use points and add labels to desired points using interactive
 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.
+displaying the most interesting labels (see
+ at uref{http://www.fromthebottomoftheheap.net/2013/01/12/decluttering-ordination-plots-in-vegan-part-1-ordilabel/,,Decluttering
+blog, part 1}).
 
 @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}.  
+with @code{orditorp} (see
+ at uref{http://www.fromthebottomoftheheap.net/2013/01/13/decluttering-ordination-plots-in-vegan-part-2-orditorp/,,Decluttering
+blog}). 
 
 @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. 
+overlap (see
+ at uref{http://www.fromthebottomoftheheap.net/2013/06/27/decluttering-ordination-plots-in-vegan-part-3-ordipointlabel/,,
+Decluttering blog}).
 
 @item
 Ordination @code{text} and @code{points} functions have argument
@@ -745,7 +754,9 @@ plotted as text or points.
 @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. 
+one set of points can be used (see
+ at uref{http://www.fromthebottomoftheheap.net/2013/12/31/decluttering-ordination-in-vegan-part-4-orditkplot/,,Decluttering
+blog}).
 
 @item 
 Most @code{plot} functions allow you to zoom to a part of the
diff --git a/vignettes/NEWS.html b/vignettes/NEWS.html
index c01b47f..4c59561 100644
--- a/vignettes/NEWS.html
+++ b/vignettes/NEWS.html
@@ -7,6 +7,133 @@
 
 <h2>vegan News</h2>
 
+<h3>Changes in version 2.3-0</h3>
+
+
+
+<h4>BUG FIXES</h4>
+
+
+<ul>
+<li><p> Constrained ordination functions <code>cca</code>, <code>rda</code> and
+<code>capscale</code> are now more robust. Scoping of data set names and
+variable names is much improved. This should fix numerous
+long-standing problems, for instance those reported by Benedicte
+Bachelot (in email) and Richard Telford (in Twitter), as well as
+issues <a href="https://github.com/vegandevs/vegan/issues/16">#16</a>
+and <a href="https://github.com/vegandevs/vegan/issues/100">#100</a> in
+GitHub.
+</p>
+</li>
+<li><p> Ordination functions <code>cca</code> and <code>rda</code> silently
+accepted dissimilarities as input although their analysis makes
+no sense with these methods. Dissimilarities should be analysed
+with distance-based redundancy analysis (<code>capscale</code>).
+</p>
+</li>
+<li><p> The variance of the conditional component was over-estimated
+in <code>goodness</code> of <code>rda</code> results, and results were wrong
+for partial RDA. The problems were reported in an
+<a href="https://stat.ethz.ch/pipermail/r-sig-ecology/2015-March/004936.html">R-sig-ecology</a>
+message by Christoph von Redwitz.
+</p>
+</li></ul>
+
+ 
+
+
+<h4>WINDOWS</h4>
+
+
+<ul>
+<li> <p><code>orditkplot</code> did not add file type identifier to saved
+graphics in Windows although that is required. The problem only
+concerned Windows OS.
+</p>
+</li></ul>
+
+ 
+
+
+<h4>NEW FEATURES AND FUNCTIONS</h4>
+
+
+<ul>
+<li> <p><code>goodness</code> function for constrained ordination
+(<code>cca</code>, <code>rda</code>, <code>capscale</code>) was redesigned. Function
+gained argument <code>addprevious</code> to add the variation explained
+by previous ordination components to axes when <code>statistic =
+      "explained"</code>. With this option, <code>model = "CCA"</code> will include
+the variation explained by partialled-out conditions, and
+<code>model = "CA"</code> will include the accumulated variation
+explained by conditions and constraints. The former behaviour was
+<code>addprevious = TRUE</code> for <code>model = "CCA"</code>, and
+<code>addprevious = FALSE</code> for <code>model = "CA"</code>. The argument
+will have no effect when <code>statistic = "distance"</code>, but this
+will always show the residual distance after all previous
+components. Formerly it displayed the residual distance only for
+the currently analysed model.
+</p>
+</li>
+<li><p> Functions <code>ordiArrowMul</code> and <code>ordiArrowTextXY</code> are
+exported and can be used in normal interactive sessions. These
+functions are used to scale a bunch arrows to fit ordination
+graphics, and formerly they were internal functions used within
+other <span class="pkg">vegan</span> functions.
+</p>
+</li>
+<li> <p><code>orditkplot</code> can export graphics in SVG format. SVG is
+a vector graphics format which can be edited with several external
+programs, such as Illustrator and Inkscape.
+</p>
+</li>
+<li><p> Rarefaction curve (<code>rarecurve</code>) and species
+accumulation models (<code>specaccum</code>, <code>fitspecaccum</code>)
+gained new functions to estimate the slope of curve at given
+location. Originally this was based on a response to an
+<a href="https://stat.ethz.ch/pipermail/r-sig-ecology/2015-May/005038.html">R-SIG-ecology</a>
+query. For rarefaction curves, the function is <code>rareslope</code>,
+and for species accumulation models it is <code>specslope</code>.
+</p>
+<p>The functions are based on analytic equations, and can also be
+evaluated at interpolated non-integer values. In
+<code>specaccum</code> models the functions can be only evaluated for
+analytic models <code>"exact"</code>, <code>"rarefaction"</code> and
+<code>"coleman"</code>. With <code>"random"</code> and <code>"collector"</code>
+methods you can only use finite differences
+(<code>diff(fitted(<result.object>))</code>). Analytic functions for
+slope are used for all non-linear regression models known to
+<code>fitspecaccum</code>.
+</p>
+</li>
+<li><p> Species accumulation models (<code>specaccum</code>) and
+non-liner regression models for species accumulation
+(<code>fitspecaccum</code>) work more consistently with weights. In
+all cases, the models are defined using the number of sites as
+independent variable, which with weights means that observations
+can be non-integer numbers of virtual sites. The <code>predict</code>
+models also use the number of sites with <code>newdata</code>,
+and for analytic models they can estimate the expected values
+for non-integer number of sites, and for non-analytic randomized
+or collector models they can interpolate on non-integer values.
+</p>
+</li>
+<li> <p><code>fitspecaccum</code> gained support functions <code>AIC</code>
+and <code>deviance</code>.
+</p>
+</li>
+<li><p> The <code>varpart</code> plots of four-component models were
+redesigned following Legendre, Borcard & Roberts <em>Ecology</em>
+93, 1234–1240 (2012), and they use now four ellipses instead of
+three circles and two rectangles. The components are now labelled
+in plots, and the circles and ellipses can be easily filled with
+transparent background colour.
+</p>
+</li></ul>
+
+ 
+
+
 <h3>Changes in version 2.2-1</h3>
 
 
diff --git a/vignettes/decision-vegan.tex b/vignettes/decision-vegan.tex
index b5ff272..17e5db8 100644
--- a/vignettes/decision-vegan.tex
+++ b/vignettes/decision-vegan.tex
@@ -9,8 +9,8 @@
 
 \date{\footnotesize{
   processed with vegan
-2.2-1
-in R Under development (unstable) (2015-01-12 r67426) on \today}}
+2.3-0
+in R Under development (unstable) (2015-05-25 r68412) on \today}}
 
 %% need no \usepackage{Sweave}
 \begin{document}
@@ -702,19 +702,19 @@ Call: cca(formula = varespec[i, ] ~ Al + K, data
 
               Inertia Proportion Rank
 Total          2.0832     1.0000     
-Constrained    0.1910     0.0917    2
-Unconstrained  1.8922     0.9083   21
+Constrained    0.1200     0.0576    2
+Unconstrained  1.9632     0.9424   21
 Inertia is mean squared contingency coefficient 
 
 Eigenvalues for constrained axes:
    CCA1    CCA2 
-0.13160 0.05938 
+0.08228 0.03767 
 
 Eigenvalues for unconstrained axes:
    CA1    CA2    CA3    CA4    CA5    CA6    CA7 
-0.4532 0.3119 0.2221 0.1933 0.1722 0.1163 0.1070 
+0.5249 0.3452 0.2173 0.1801 0.1748 0.1155 0.0889 
    CA8 
-0.0869 
+0.0814 
 (Showed only 8 of all 21 unconstrained eigenvalues)
 \end{Soutput}
 \end{Schunk}
@@ -742,11 +742,11 @@ remain within numerical accuracy:
 > max(residuals(proc))
 \end{Sinput}
 \begin{Soutput}
-[1] 2.895313e-14
+[1] 3.149138e-14
 \end{Soutput}
 \end{Schunk}
 In \code{cca} the difference would be somewhat larger than now
-observed 2.8953e-14 because site
+observed 3.1491e-14 because site
 weights used for environmental variables are shuffled with the species
 data.
 
diff --git a/vignettes/diversity-vegan.tex b/vignettes/diversity-vegan.tex
index 1d153bb..45342e3 100644
--- a/vignettes/diversity-vegan.tex
+++ b/vignettes/diversity-vegan.tex
@@ -10,8 +10,8 @@
 \title{Vegan: ecological diversity} \author{Jari Oksanen} 
 
 \date{\footnotesize{
-  processed with vegan 2.2-1
-  in R Under development (unstable) (2015-01-12 r67426) on \today}}
+  processed with vegan 2.3-0
+  in R Under development (unstable) (2015-05-25 r68412) on \today}}
 
 %% need no \usepackage{Sweave}
 \begin{document}
@@ -346,14 +346,14 @@ log-series for a randomly selected plot is (Fig.~\ref{fig:fisher}):
 \end{Sinput}
 \begin{Soutput}
 Fisher log series model
-No. of species: 91 
-Fisher alpha:   35.84847 
+No. of species: 93 
+Fisher alpha:   39.21057 
 \end{Soutput}
 \end{Schunk}
 \begin{figure}
 \includegraphics{diversity-vegan-017}
 \caption{Fisher's log-series fitted to one randomly selected site
-  (22).}
+  (17).}
 \label{fig:fisher}
 \end{figure}
 We already saw $\alpha$ as a diversity index.
@@ -377,7 +377,7 @@ octave, and the same for all species at the octave limits occurring 2,
 the lower octave.  Function \code{prestondistr} directly maximizes
 truncated log-normal likelihood without binning data, and it is the
 recommended alternative.  Log-normal models usually fit poorly to the
-BCI data, but here our random plot (number 22):
+BCI data, but here our random plot (number 17):
 \begin{Schunk}
 \begin{Sinput}
 > prestondistr(BCI[k,])
@@ -385,18 +385,18 @@ BCI data, but here our random plot (number 22):
 \begin{Soutput}
 Preston lognormal model
 Method: maximized likelihood to log2 abundances 
-No. of species: 91 
+No. of species: 93 
 
       mode      width         S0 
- 0.6707546  1.8437957 24.0831256 
+ 0.5486774  1.7318443 26.3054207 
 
 Frequencies by Octave
-                0       1        2        3        4
-Observed 19.50000 28.5000 15.50000 14.50000 8.000000
-Fitted   22.54109 23.7022 18.57176 10.84347 4.717738
-                5         6
-Observed 3.000000 2.0000000
-Fitted   1.529503 0.3695023
+                0        1      2         3        4
+Observed 20.00000 31.00000 23.000 11.000000 3.000000
+Fitted   25.01783 25.42717 18.516  9.660439 3.611164
+                 5        6
+Observed 3.0000000 2.000000
+Fitted   0.9671599 0.185588
 \end{Soutput}
 \end{Schunk}
 
@@ -435,26 +435,26 @@ set gives (Fig.~\ref{fig:rad}):
 \end{Sinput}
 \begin{Soutput}
 RAD models, family poisson 
-No. of species 91, total abundance 418
-
-           par1      par2     par3    Deviance
-Null                                  114.1747
-Preemption  0.051814                  110.5156
-Lognormal   0.75751   1.2637           26.2510
-Zipf        0.16662  -0.92076          15.5222
-Mandelbrot  0.34281  -1.1219   1.2679   9.6047
-           AIC      BIC     
-Null       370.1156 370.1156
-Preemption 368.4564 370.9673
-Lognormal  286.1919 291.2136
-Zipf       275.4630 280.4847
-Mandelbrot 271.5455 279.0781
+No. of species 93, total abundance 381
+
+           par1      par2     par3    Deviance AIC    
+Null                                  138.506  390.830
+Preemption  0.050488                  134.435  388.759
+Lognormal   0.64126   1.2648           52.994  309.318
+Zipf        0.16818  -0.92746          30.855  287.179
+Mandelbrot  0.5011   -1.2287   2.0074  17.027  275.352
+           BIC    
+Null       390.830
+Preemption 391.292
+Lognormal  314.384
+Zipf       292.244
+Mandelbrot 282.949
 \end{Soutput}
 \end{Schunk}
 \begin{figure}
 \includegraphics{diversity-vegan-020}
 \caption{Ranked abundance distribution models for a random plot
-  (no. 22).  The best model has the lowest \textsc{aic}.}
+  (no. 17).  The best model has the lowest \textsc{aic}.}
 \label{fig:rad}
 \end{figure}
 
@@ -813,10 +813,10 @@ the plots (but this is rarely true):
 > specpool(BCI[s,])
 \end{Sinput}
 \begin{Soutput}
-    Species   chao  chao.se  jack1 jack1.se  jack2
-All     212 231.44 9.819491 237.92 8.309224 246.89
-        boot boot.se  n
-All 224.7046 4.71474 25
+    Species    chao  chao.se  jack1 jack1.se    jack2
+All     210 223.824 7.431665 233.04 5.963086 237.4867
+        boot  boot.se  n
+All 221.7912 4.001204 25
 \end{Soutput}
 \end{Schunk}
 
@@ -833,12 +833,12 @@ two of these methods:
 > estimateR(BCI[k,])
 \end{Sinput}
 \begin{Soutput}
-                 22
-S.obs     91.000000
-S.chao1  130.000000
-se.chao1  16.580069
-S.ACE    141.966707
-se.ACE     6.459391
+                 17
+S.obs     93.000000
+S.chao1  126.913043
+se.chao1  14.130714
+S.ACE    137.197249
+se.ACE     6.495766
 \end{Soutput}
 \end{Schunk}
 In abundance based models $a_i$ denotes the number of species with $i$
@@ -914,14 +914,14 @@ can try:
 \end{Sinput}
 \begin{Soutput}
 Extrapolated     Observed       Veiled 
-   111.30523     91.00000     20.30523 
+    114.1942      93.0000      21.1942 
 \end{Soutput}
 \begin{Sinput}
 > veiledspec(BCI[k,])
 \end{Sinput}
 \begin{Soutput}
 Extrapolated     Observed       Veiled 
-   129.14959     91.00000     38.14959 
+   126.01983     93.00000     33.01983 
 \end{Soutput}
 \end{Schunk}
 
diff --git a/vignettes/intro-vegan.tex b/vignettes/intro-vegan.tex
index 9d37785..4ccdcab 100644
--- a/vignettes/intro-vegan.tex
+++ b/vignettes/intro-vegan.tex
@@ -8,8 +8,8 @@
 
 \date{\footnotesize{
   processed with vegan
-2.2-1
-in R Under development (unstable) (2015-01-12 r67426) on \today}}
+2.3-0
+in R Under development (unstable) (2015-05-25 r68412) on \today}}
 
 %% need no \usepackage{Sweave}
 \begin{document}
@@ -113,8 +113,11 @@ species scores to the configuration as weighted averages (function
 \end{Sinput}
 \begin{Soutput}
 Run 0 stress 0.1192678 
-Run 1 stress 0.1192682 
-... procrustes: rmse 0.0003682283  max resid 0.001132974 
+Run 1 stress 0.1183187 
+... New best solution
+... procrustes: rmse 0.02026168  max resid 0.06491274 
+Run 2 stress 0.118319 
+... procrustes: rmse 0.0001018938  max resid 0.0002761111 
 *** Solution reached
 \end{Soutput}
 \begin{Sinput}
@@ -130,9 +133,9 @@ Data:     dune
 Distance: bray 
 
 Dimensions: 2 
-Stress:     0.1192678 
+Stress:     0.1183187 
 Stress type 1, weak ties
-Two convergent solutions found after 1 tries
+Two convergent solutions found after 2 tries
 Scaling: centring, PC rotation, halfchange scaling 
 Species: expanded scores based on ‘dune’ 
 \end{Soutput}
@@ -291,7 +294,7 @@ variables using permutation tests:
 ***VECTORS
 
      NMDS1   NMDS2     r2 Pr(>r)  
-A1 0.99008 0.14052 0.3798  0.021 *
+A1 0.96462 0.26365 0.3649  0.015 *
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 Permutation: free
@@ -301,14 +304,14 @@ Number of permutations: 999
 
 Centroids:
                NMDS1   NMDS2
-ManagementBF -0.4474 -0.0193
-ManagementHF -0.2689 -0.1256
-ManagementNM  0.2976  0.5798
-ManagementSF  0.1502 -0.4654
+ManagementBF -0.4533 -0.0104
+ManagementHF -0.2635 -0.1283
+ManagementNM  0.2954  0.5791
+ManagementSF  0.1508 -0.4670
 
 Goodness of fit:
                r2 Pr(>r)   
-Management 0.4134   0.01 **
+Management 0.4133  0.004 **
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 Permutation: free
@@ -337,12 +340,11 @@ Link function: identity
 
 Formula:
 y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
-<environment: 0x7b18f20>
 
 Estimated degrees of freedom:
-1.62  total = 2.62 
+1.59  total = 2.59 
 
-REML score: 41.42642     
+REML score: 41.58728     
 \end{Soutput}
 \end{Schunk}
 \begin{figure}
@@ -481,7 +483,7 @@ Number of permutations: 199
 
 Model: cca(formula = dune ~ A1 + Management, data = dune.env)
            Df ChiSquare      F Pr(>F)   
-A1          1   0.22476 2.5245  0.010 **
+A1          1   0.22476 2.5245  0.015 * 
 Management  3   0.55502 2.0780  0.005 **
 Residual   15   1.33549                 
 ---
@@ -503,7 +505,7 @@ Number of permutations: 199
 
 Model: cca(formula = dune ~ A1 + Management, data = dune.env)
            Df ChiSquare      F Pr(>F)   
-A1          1   0.17594 1.9761  0.050 * 
+A1          1   0.17594 1.9761  0.025 * 
 Management  3   0.55502 2.0780  0.005 **
 Residual   15   1.33549                 
 ---
@@ -526,8 +528,8 @@ Model: cca(formula = dune ~ A1 + Management, data = dune.env)
          Df ChiSquare      F Pr(>F)   
 CCA1      1   0.31875 3.5801  0.002 **
 CCA2      1   0.23718 2.6640  0.006 **
-CCA3      1   0.13217 1.4845  0.120   
-CCA4      1   0.09168 1.0297  0.426   
+CCA3      1   0.13217 1.4845  0.114   
+CCA4      1   0.09168 1.0297  0.380   
 Residual 15   1.33549                 
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
@@ -580,8 +582,8 @@ Number of permutations: 499
 
 Model: cca(formula = dune ~ A1 + Management + Condition(Moisture), data = dune.env)
            Df ChiSquare      F Pr(>F)  
-A1          1   0.11543 1.4190  0.112  
-Management  3   0.39543 1.6205  0.014 *
+A1          1   0.11543 1.4190  0.108  
+Management  3   0.39543 1.6205  0.012 *
 Residual   12   0.97610                
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
@@ -607,8 +609,8 @@ Number of permutations: 499
 
 Model: cca(formula = dune ~ A1 + Management + Condition(Moisture), data = dune.env)
            Df ChiSquare      F Pr(>F)   
-A1          1   0.11543 1.4190  0.256   
-Management  3   0.39543 1.6205  0.006 **
+A1          1   0.11543 1.4190  0.270   
+Management  3   0.39543 1.6205  0.002 **
 Residual   12   0.97610                 
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-cran-vegan.git



More information about the debian-med-commit mailing list