[med-svn] [r-cran-vegan] 01/05: New upstream version 2.4-4

Andreas Tille tille at debian.org
Thu Sep 7 12:08:50 UTC 2017


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

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

commit 113893e01edbf9b183b5ffa75cb4c16303878c85
Author: Andreas Tille <tille at debian.org>
Date:   Thu Sep 7 13:04:41 2017 +0200

    New upstream version 2.4-4
---
 DESCRIPTION                  |   8 +--
 MD5                          |  92 ++++++++++++++++----------------
 NAMESPACE                    |   2 +-
 R/anova.ccabyterm.R          |  19 ++++---
 R/as.mlm.cca.R               |  10 ++--
 R/as.mlm.rda.R               |   7 +--
 R/biplot.rda.R               |   2 +-
 R/cca.default.R              |   6 ++-
 R/envfit.default.R           |   2 +-
 R/inertcomp.R                |   6 +--
 R/intersetcor.R              |  19 ++++---
 R/ordiParseFormula.R         |  13 +++--
 R/ordiR2step.R               |  55 +++++++++----------
 R/ordiTerminfo.R             |   5 +-
 R/ordiYbar.R                 | 123 +++++++++++++++++++++++++++++++++++++++++++
 R/ordispider.R               |  11 ++--
 R/ordisurf.R                 |   9 ++--
 R/orditkplot.R               |  10 ++--
 R/plot.meandist.R            |   4 +-
 R/spenvcor.R                 |  10 ++--
 R/summary.cca.R              |   4 +-
 R/tolerance.cca.R            |  23 ++++++--
 R/veganMahatrans.R           |   9 ++--
 R/vegdist.R                  |   3 +-
 build/partial.rdb            | Bin 21870 -> 21902 bytes
 build/vignette.rds           | Bin 347 -> 348 bytes
 inst/NEWS.Rd                 | 116 +++++++++++++++++++++++++++++++++++++++-
 inst/doc/FAQ-vegan.Rmd       |  21 ++++----
 inst/doc/FAQ-vegan.html      |  21 ++++----
 inst/doc/decision-vegan.pdf  | Bin 340533 -> 340989 bytes
 inst/doc/diversity-vegan.pdf | Bin 364765 -> 365557 bytes
 inst/doc/intro-vegan.pdf     | Bin 238492 -> 238607 bytes
 inst/doc/partitioning.pdf    | Bin 137361 -> 137352 bytes
 man/MOStest.Rd               |   2 +-
 man/cca.Rd                   |   2 +-
 man/cca.object.Rd            |  32 +++++++----
 man/envfit.Rd                |  22 ++++----
 man/mso.Rd                   |   2 +-
 man/ordistep.Rd              |  64 +++++++++++-----------
 man/ordisurf.Rd              |   2 +-
 man/orditkplot.Rd            |  33 +++++++-----
 man/plot.cca.Rd              |  10 ----
 man/specaccum.Rd             |   2 +-
 man/vegan-internal.Rd        |   2 +-
 man/vegdist.Rd               |   8 ++-
 src/init.c                   |  79 +++++++++++++++++++++++++++
 src/vegdist.c                |   2 +-
 vignettes/FAQ-vegan.Rmd      |  21 ++++----
 48 files changed, 628 insertions(+), 265 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 68fda56..b3957e1 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 2.4-2
-Date: 2017-01-17
+Version: 2.4-4
+Date: 2017-08-24
 Author: Jari Oksanen, F. Guillaume Blanchet, Michael Friendly, Roeland Kindt,
    Pierre Legendre, Dan McGlinn, Peter R. Minchin, R. B. O'Hara,
    Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens, Eduard Szoecs,
@@ -17,6 +17,6 @@ License: GPL-2
 BugReports: https://github.com/vegandevs/vegan/issues
 URL: https://cran.r-project.org, https://github.com/vegandevs/vegan
 NeedsCompilation: yes
-Packaged: 2017-01-17 13:20:06 UTC; jarioksa
+Packaged: 2017-08-24 11:35:21 UTC; jarioksa
 Repository: CRAN
-Date/Publication: 2017-01-17 19:41:27
+Date/Publication: 2017-08-24 14:40:17 UTC
diff --git a/MD5 b/MD5
index 0163689..389ef65 100644
--- a/MD5
+++ b/MD5
@@ -1,5 +1,5 @@
-4598b2d294cb96a71a6b964047b44d63 *DESCRIPTION
-ad7596a4d60e6ab02877ab7a75271d33 *NAMESPACE
+05eb4ffa9af4eefed577c7ef2ce3afbe *DESCRIPTION
+b6c1ba5174f4c13ee5c1263b3415eff2 *NAMESPACE
 4b8531b446af54510e5fb31f841aed2f *R/AIC.radfit.R
 e9814d051bdf49db5606399ac3a4704e *R/CCorA.R
 da0ea7ae9e283690809aba8077a84671 *R/GowerDblcen.R
@@ -22,7 +22,7 @@ d80688d78aba3cd9367ffaaaec6ec252 *R/TukeyHSD.betadisper.R
 4bdae1555a954b5266ac30300783ffd8 *R/anosim.R
 a4f23289c4a5eab2a3587292b306d497 *R/anova.betadisper.R
 74c2e9a04d759679b59363f641c91ba7 *R/anova.cca.R
-f6891cf038af4209dfdf9eac1ab4de08 *R/anova.ccabyterm.R
+275fc75ab96b0569cb6e0f75caeabc63 *R/anova.ccabyterm.R
 cd89ea579a34db076f699d05645a7b8e *R/anova.ccalist.R
 4f82772f1ce6f20d1b2485138aaa7609 *R/anova.ccanull.R
 7fab08bcc596df60a22c4b04c8507121 *R/anova.prc.R
@@ -31,8 +31,8 @@ eded8dec556ee875d56887859b0abee8 *R/as.fisher.R
 96dbacc8c238120ee7853fc399a956c9 *R/as.mcmc.oecosimu.R
 cfaa7dc7d3f45c29e59e83326f1371d4 *R/as.mcmc.permat.R
 71fe13d6613d600ccb8b5894a55b87a3 *R/as.mlm.R
-340f6a922578c8965803c63e08c5abbf *R/as.mlm.cca.R
-ec4c60b2bae11116b56946b136a78ed0 *R/as.mlm.rda.R
+04e68f763a80458233c23ebf7ca399f1 *R/as.mlm.cca.R
+f811921a26c73d7a5adcbafd35d5280a *R/as.mlm.rda.R
 a7f01bd69394d5554cf10279a2690080 *R/as.preston.R
 50aa2e700cc26301885d9ef7ca7f12c4 *R/as.rad.R
 a9297920fdeeb053cfe57930118ca20c *R/as.ts.oecosimu.R
@@ -45,7 +45,7 @@ fbec6d133dea10372ce082c7035a8ab2 *R/beals.R
 68f7dc3b2c6c698c3288605c90f5cd80 *R/bioenv.default.R
 c41d73027fbc46fc9c71c627d1994a66 *R/bioenv.formula.R
 4dbe9f135fadbba3f6939d64a5bb0e29 *R/biplot.CCorA.R
-f22e634bf8399d7edb1fe05845921ccf *R/biplot.rda.R
+683881621ee922e1fd30c77f31ee8909 *R/biplot.rda.R
 0999bb90f22b72fade2ca6adbd01758f *R/boxplot.betadisper.R
 dd03c1ef27bc56d056dc761fd7ecd153 *R/boxplot.specaccum.R
 cbf54233db3c2839101f98e02eb538dd *R/bstick.R
@@ -61,7 +61,7 @@ f56b52d53b17c7dc8d8c9accd5a3401a *R/calibrate.ordisurf.R
 176ac0fc7d603de0ef7f490217de7009 *R/capscale.R
 52b06d758d53934d0b67b4e7653dc3dd *R/cascadeKM.R
 2e09a82ec52e211afc2ac6e8d4b40898 *R/cca.R
-fe3b7320b434d46d2308d880ef26787a *R/cca.default.R
+08ee285d0453ec46ba8c79366ed84c23 *R/cca.default.R
 ef3f23773999c3466c303c79b98375f0 *R/cca.formula.R
 efd5146e35f97186b97ca1bb6e618c79 *R/centroids.cca.R
 c66d8fbe69ccca94f2ee8f777ff16ae2 *R/checkSelect.R
@@ -89,7 +89,7 @@ cafeabc2133997b3381c9edf6a971abf *R/distconnected.R
 79c66a10794aacaf08f1d28192228bea *R/eigengrad.R
 3481fc55ba439f64100b3954f2e775a3 *R/eigenvals.R
 17a62527ee103c09bfba0c851ab12560 *R/envfit.R
-8b55b666951751cfd6cb9720c886677e *R/envfit.default.R
+f95e374ad94346f78ec0b4b929f39b28 *R/envfit.default.R
 3daf51b37b06f56aaa7bcdf740c46eb4 *R/envfit.formula.R
 0b5f742d4f302ab12c17fe3fc3e3deee *R/estaccumR.R
 81098475867f802dea0565fe426c9fc5 *R/estimateR.R
@@ -123,9 +123,9 @@ d10f4168f5119180dfd4a7bf57f444d6 *R/howHead.R
 d02fc9c672a9b2c4a31065702a3381be *R/humpfit.R
 1637bd10b39801c14b65656f29dafcf1 *R/identify.ordiplot.R
 9e731fa2cfb821bbe7ed62336d5fa3b3 *R/indpower.R
-56b994a6310b74f9891e7af4cd461c6d *R/inertcomp.R
+7e4d848df4b8e266b7441f0f9be13e10 *R/inertcomp.R
 bf423cb7cf07abc3a4c64229bcc8fc14 *R/initMDS.R
-c1202a1639faec44406e0cc5adf96055 *R/intersetcor.R
+2282a508f8d362c7184ba1b42df6cd2d *R/intersetcor.R
 c63972a171f76f92652feeb2daf30e82 *R/isomap.R
 1e167e69edcee4aa651d97bef81b31e9 *R/isomapdist.R
 5abdcd58cf3811e482543d5207114331 *R/kendall.global.R
@@ -173,9 +173,10 @@ fe4f72fa1928f93c92840af2ae08b52e *R/ordiArgAbsorber.R
 ffd002ae0ed83062dabb963f02f3c854 *R/ordiArrowMul.R
 1f50c54490f6cbfa7300255219939ccb *R/ordiArrowTextXY.R
 99c1ec285e2afe4fb8beccbd507a123e *R/ordiNAexclude.R
-045e89399470e8c72a875570e1229bf2 *R/ordiParseFormula.R
-477035081490c768593968825b58b831 *R/ordiR2step.R
-7757339f5b8899cb54f13da274abda66 *R/ordiTerminfo.R
+524552fe7ed8073bd7c5f22aa4fd2c05 *R/ordiParseFormula.R
+40ef1c428a346a726bcfba6a42ce68b5 *R/ordiR2step.R
+097816aa72677bacfa2e0044c1c554cf *R/ordiTerminfo.R
+0479dddb459689b902afc44295bd5f7a *R/ordiYbar.R
 a1a229f63a785534a5135815564d4581 *R/ordiareatest.R
 a7f82442062699d56ea176a7d87e9ac4 *R/ordiarrows.R
 2b2c4ee6b157be9425eff260647b5c39 *R/ordibar.R
@@ -191,11 +192,11 @@ c805e6801ef30758b9f7718269cabdfc *R/ordimedian.R
 4f4fd722823b3825edd1b5c1fdb6888c *R/ordipointlabel.R
 e57a2b904e572829a5fd97f5b6576644 *R/ordiresids.R
 247ea2a9441bf23573e6ee169bad16b3 *R/ordisegments.R
-a36e6b384a4e198d0466fb0a883102aa *R/ordispider.R
+a4872e171e115d248db3863f1c989a61 *R/ordispider.R
 96516a08af37e2e3066799d466826889 *R/ordisplom.R
 c8316cf02745d66e730cdd6b9d62375e *R/ordistep.R
-a6108f550b749db7139b143cc9e36c9c *R/ordisurf.R
-da612e647de9c2a0dd853bec899ea620 *R/orditkplot.R
+3b80a8393c6d205a6dcd80baeed0fa38 *R/ordisurf.R
+b20a02ac38859dd3f8723876b8a1a9c3 *R/orditkplot.R
 bc3671e5b7a30e2849d3b59f65783c97 *R/orditorp.R
 5a99010a09cd4a018b02d397be8cc4ec *R/ordixyplot.R
 9fe401c201c03826754ec5613f6ecd71 *R/panel.ordi.R
@@ -224,7 +225,7 @@ dc793c47c821ba2961bf284132997ba3 *R/plot.contribdiv.R
 9a4f1746e6e5b80b48994f404e72eb74 *R/plot.humpfit.R
 23154f6b1812303cbfbfde78711d465a *R/plot.isomap.R
 55a0851dbcb231f65f8da29e2b904780 *R/plot.mantel.correlog.R
-75636876eb91eb8098c807a2ea508efb *R/plot.meandist.R
+63ef57200878655ad91116be40dca55f *R/plot.meandist.R
 aeddafb96f777e9905a1c4660ed3cadc *R/plot.metaMDS.R
 2574a84757435e0594f89434a9f4ec82 *R/plot.nestedtemp.R
 df06e0f9bd4bc8a546adf466c6daeca6 *R/plot.ordipointlabel.R
@@ -383,14 +384,14 @@ f4554cf72cc501fad09662c612b1c34c *R/spantree.R
 4899dc4b2bcaf5c269cbd0f69cb3fc12 *R/specpool.R
 77cc19684e9ceb27500ca7f802923328 *R/specpool2vect.R
 d24743b3fb58c8a195608e814eeed02c *R/specslope.R
-25c178b8a56af16bf12135dce7d226d8 *R/spenvcor.R
+adb0168be76e2e4659d14fb0a6db5204 *R/spenvcor.R
 33d884aae53dcc5fa80d9e9ffae4515e *R/stepacross.R
 bd2d1d998f18e7a9c65d5072932cbef2 *R/str.nullmodel.R
 301ba29a09201611845f7adb2b2d7d81 *R/stressplot.R
 eb7fedcd67e50aa63a1557aa3c608ddf *R/stressplot.wcmdscale.R
 55b28298153f00b4c1f8574b0784eb0c *R/summary.anosim.R
 19ce7c501fff2cacc8ad322fd0500a48 *R/summary.bioenv.R
-7fea8ad8bbbfb61348faaa76ea44725b *R/summary.cca.R
+4f6e6b0c5749c3c197e1dc7e00afa0b1 *R/summary.cca.R
 c1f7a5045e57ac95c9ae7f13f2a11743 *R/summary.clamtest.R
 bf8be2e9b02c1a3cd5f3ad0005e8354c *R/summary.decorana.R
 088b8c747d67fa5ad158304a21f32628 *R/summary.dispweight.R
@@ -416,7 +417,7 @@ c103958b08a39e45f44ed5b55c380d25 *R/text.cca.R
 974bdc93cd9b352d30debf3e93111136 *R/text.ordiplot.R
 dbc282f5aef3c9729d098b4fb80004b7 *R/text.orditkplot.R
 0fc7a75cf414d76cc751cc33ed5d6384 *R/tolerance.R
-8a114b5c20e46c089ecd9f80ed0f27e5 *R/tolerance.cca.R
+c7b19a898be981bde00d64727f604377 *R/tolerance.cca.R
 48c49511d26ea0e18e752198ecde97ba *R/treedist.R
 54b0bf2548f7912cf4c10d4552d58efc *R/treedive.R
 b7181b8d28c9da1019a0b2fe5f117e05 *R/treeheight.R
@@ -431,9 +432,9 @@ b0941cf2b3322fcf2dd4d51578ee4e3c *R/update.nullmodel.R
 bf26b2480075f8f1357d5324391b527e *R/vegan-defunct.R
 1df623721f7674c43c13a696b3082249 *R/vegan-deprecated.R
 129a1cf5e913a365ffd679b63378811b *R/veganCovEllipse.R
-5656cc97f30992a5e02dba21b2846485 *R/veganMahatrans.R
+106ff78fb7ba42a6f6599beee8c34c4e *R/veganMahatrans.R
 d52de59290b2eced0f79926ea655652c *R/vegandocs.R
-da1732f7e84a448d32d929d00c9f2bc6 *R/vegdist.R
+f5edfb9845dd38cc45377d463a22347d *R/vegdist.R
 b1855fd70cd8c70e9b480605297bcc63 *R/vegemite.R
 5d6047d7f63f04ae9ff40179c534aa0b *R/veiledspec.R
 4d0f113e697fb166ba912ac34b40b3dc *R/vif.cca.R
@@ -444,8 +445,8 @@ ecfd48e2f4df6bcd683a87203dd80e12 *R/weights.cca.R
 9ed0ac2ab6e01950db0cc181a42e523f *R/weights.rda.R
 4138f57726620d493f218e5e3da0013c *R/wisconsin.R
 678368022e0d66a4fd7722ab6bcc8beb *R/zzz.R
-7f5f6d32b2e1a254b5645dbabc58f880 *build/partial.rdb
-bf482d265609ebdc74921368caf131a8 *build/vignette.rds
+b9dbcf6627ff296aab3b7ebdcf912ba8 *build/partial.rdb
+5eccc2c18d20ec3f7fe97bc06a859c5e *build/vignette.rds
 72cc26156e4b9ce7e2655c228ab87107 *data/BCI.env.rda
 0a5c36b1ebd892c80a84d0d6417e1d6f *data/BCI.rda
 412ea5cf443401fe54f0b14c14c45806 *data/dune.env.rda
@@ -460,28 +461,28 @@ c51905bd025ccea2737527b6fca4a081 *data/mite.pcnm.rda
 ee3c343418d7cf2e435028adf93205f1 *data/sipoo.rda
 f87df84297865b5faf31e232e97a0f94 *data/varechem.rda
 7136b8666250a538d60c88869390a085 *data/varespec.rda
-23e8211d6b2aa00d4e78e8dc3aa73c2f *inst/NEWS.Rd
+2dea843fada59bb784eeba6efff6d352 *inst/NEWS.Rd
 9abfab8b05c34dd283379a7d87500ffb *inst/ONEWS
 1fb35aec7042529e18e4673818fecf7f *inst/OldChangeLog
 b21accfb0a73075d80634960e461ac7e *inst/doc/FAQ-vegan.R
-5a63786318301497a2ff53b27afd94e9 *inst/doc/FAQ-vegan.Rmd
-da32fa53640082fe265ae96e87445079 *inst/doc/FAQ-vegan.html
+59b920cd88206c7d709034c589fce4aa *inst/doc/FAQ-vegan.Rmd
+4129dc38c93bd1d2cdf1631d66f350b0 *inst/doc/FAQ-vegan.html
 92fd39278aa2666ce4fec88c032b33ed *inst/doc/decision-vegan.R
 c910da720c0da49de1808c688a450206 *inst/doc/decision-vegan.Rnw
-b4b72dfffc0571804c618d4027932283 *inst/doc/decision-vegan.pdf
+ebb7e59b358147ffb3bb689e617931d2 *inst/doc/decision-vegan.pdf
 41fae44349a8a602825bddba8750102d *inst/doc/diversity-vegan.R
 06cfa11a83ca0330979d500549f2415a *inst/doc/diversity-vegan.Rnw
-ba77aab598df214db58eb2f63d43da17 *inst/doc/diversity-vegan.pdf
+30a73bade14ab78553c9a40e91866bab *inst/doc/diversity-vegan.pdf
 eff5665df3e4437135528b753d664a7f *inst/doc/intro-vegan.R
 6b35943a07c04a6afc77222b0e17b7f8 *inst/doc/intro-vegan.Rnw
-51ff72da0df8c9f7d49166967c7bfaa4 *inst/doc/intro-vegan.pdf
+0bcff85db0bab5f236cf6a5c1e2bb951 *inst/doc/intro-vegan.pdf
 d56c6fb7eaff59b945aad2459b96bce7 *inst/doc/partitioning.R
 5b17ce6c86e3334b796a658328d426f9 *inst/doc/partitioning.Rnw
-aa3e03a8c197428b17cbb71342249c35 *inst/doc/partitioning.pdf
+2cb32686c13a1ec722138a7adb38fa19 *inst/doc/partitioning.pdf
 1f5ef97a44dee865f33b8eadb2e206c1 *man/BCI.Rd
 d4d97e3b71561f61bd9f1f0686a57434 *man/CCorA.Rd
 2b36702bf2b1931f955fb7dd9d044c99 *man/MDSrotate.Rd
-fd218be03aa2591e5123d11780ccba1a *man/MOStest.Rd
+fdaddfe3df6da06b251f0b1a6fdf5671 *man/MOStest.Rd
 603087a66c6c10720229d00bc499545d *man/RsquareAdj.Rd
 73f141f28a1aca961cd4e992d8610934 *man/SSarrhenius.Rd
 32f805196e58b526c3a2bab5c87116b3 *man/add1.cca.Rd
@@ -498,8 +499,8 @@ b04c2fae35dba2d97cb248814d5e2fe9 *man/bgdispersal.Rd
 783cc695729b9ce5ce9331944337541f *man/biplot.rda.Rd
 3692d544d02a8ce24fab53142a4eb9b1 *man/capscale.Rd
 644e253ebcab91a5ddce85294dda278d *man/cascadeKM.Rd
-aabb7dbe6885e0362b5c92a47c856b54 *man/cca.Rd
-bd548455eb7f153d33932dc4f3ba44a9 *man/cca.object.Rd
+607ceb62c897138072bba4660620e0e0 *man/cca.Rd
+049dc7953e5708a931d12484f081726c *man/cca.object.Rd
 b97d41cd8bf114b7ca7560b4dd9e58e6 *man/clamtest.Rd
 15ffd9b28bf53976177020d25e9ae870 *man/commsim.Rd
 335d0f7691ad9d0c48fffce9f9db6201 *man/contribdiv.Rd
@@ -514,7 +515,7 @@ f3f742efa7511a4c33108a00b512ebd9 *man/distconnected.Rd
 08b96c1a45c11ffcb7f0da33a888421a *man/dune.Rd
 4548669f5df26e953e52fbd6daa3a532 *man/dune.taxon.Rd
 5f5f8c7df063606ccde6124c5dbe8add *man/eigenvals.Rd
-e3e4972c0872f98244211540657cb371 *man/envfit.Rd
+826f1c80af60f7eaff882738563b10d1 *man/envfit.Rd
 d2cf422a3d7702ac6293fcd3ff046afc *man/eventstar.Rd
 5857c2307b1dfd69953a88bd3c384180 *man/fisherfit.Rd
 4135cbc750171f53a71e727291162bf8 *man/goodness.cca.Rd
@@ -532,7 +533,7 @@ f053b9a61134bcda5daaffa21509c530 *man/metaMDS.Rd
 c50bd45c9e8c6e892d2dd8f7fe5f0bd9 *man/model.matrix.cca.Rd
 9ce82e46d744c868c00924d8866dc228 *man/monoMDS.Rd
 735dd0c405cedd8f6eeedddae86d86b4 *man/mrpp.Rd
-dedc3d36bc5430ef525ee1998206ed3b *man/mso.Rd
+c52ffac414ef6e1e71eae55f025289bc *man/mso.Rd
 7ed0b0f6beff14cc292c361550f562e8 *man/multipart.Rd
 53bf1a9a10f3b6febebffaaedf13f79d *man/nestedtemp.Rd
 c7f768b6f36aec4bc9d5b4c8f72c1141 *man/nobs.adonis.Rd
@@ -545,9 +546,9 @@ e9de6d6e919df1849ccfa508904adf9b *man/nullmodel.Rd
 994cfc973f88c682b741e48377e1b9b4 *man/ordiplot.Rd
 b23bb4e1b39d8d0e0309bd909a247786 *man/ordipointlabel.Rd
 d4d27a34b2e7d9d1b732a0d06cb9d9f4 *man/ordiresids.Rd
-9831ceea3c75b168317477a916f4c49b *man/ordistep.Rd
-8bf72310b1707b85af6eb08fc9180671 *man/ordisurf.Rd
-fa3c7cc7f1084be4507b1a87ed012718 *man/orditkplot.Rd
+2d8b9cff36dea3ca25222336e89b0575 *man/ordistep.Rd
+0cc8b4a8345c09a2b31ea8f82b0546cd *man/ordisurf.Rd
+5a6e631b51c50758c290c5c1db29f217 *man/orditkplot.Rd
 8785cc44c56d1b24fbcbde8de9e325d5 *man/orditorp.Rd
 45ac08204e0f9a3fa674b437b72a3d4e *man/ordixyplot.Rd
 e8a307f119251e6651dacf18c182f73f *man/pcnm.Rd
@@ -555,7 +556,7 @@ d3fd306546c43339ad7d8fd985a28801 *man/permatfull.Rd
 6812983f8e154a66bd4ec3c736d1b36a *man/permustats.Rd
 4a2ed8481b1f6805d343e83fda91e0ed *man/permutations.Rd
 7533f16237c68f522d66d70b05a99c76 *man/permutest.betadisper.Rd
-55b066a2bb2dc47997c76c2ae6155dca *man/plot.cca.Rd
+e4d397eb7ca88b56ac92e452598c2d23 *man/plot.cca.Rd
 d45a85e1ccef663ad3bc6d87286f5904 *man/prc.Rd
 0f7fb32afada9a6d1c274875465abad7 *man/predict.cca.Rd
 e29ed0c997c75aa9e229ae847e3d1cf6 *man/procrustes.Rd
@@ -573,7 +574,7 @@ eec06fd5cfdddadb56bca849f88b38f0 *man/reorder.hclust.Rd
 621f8a2810727ab3523fc0bd69a56dca *man/simulate.rda.Rd
 2a9336794ae5a322bf2ce6b71edb3f0c *man/sipoo.Rd
 fa1142a6350045acf397a99bbed4ef04 *man/spantree.Rd
-1bfd519e9cad6de99a4081375d376dad *man/specaccum.Rd
+32061b3ad89a84e6649a4af3f4361d25 *man/specaccum.Rd
 c334f2fca856d5073044392713ee0894 *man/specpool.Rd
 5b9e51c85395f80f8504954e4175f877 *man/stepacross.Rd
 9a022e15270dc4d340207f34beb038a1 *man/stressplot.wcmdscale.Rd
@@ -585,10 +586,10 @@ a4b37297402220dee75997c4f49a729c *man/treedive.Rd
 a6280a68ce4a9298bc68d7ca5f768a2f *man/varpart.Rd
 3c0ab1f2a60eff99bbc3f7a33c3f6eee *man/vegan-defunct.Rd
 00b4cef1efbd187368d0905e3b298cfd *man/vegan-deprecated.Rd
-4f9d5a46d163e48df77f5f668d4d55a2 *man/vegan-internal.Rd
+0db28cb76288e9906cf95c4858dc0705 *man/vegan-internal.Rd
 cef033ea30c92a1508f82924ce9f2402 *man/vegan-package.Rd
 5280fd8e6478cff76373f5e85422ae5b *man/vegandocs.Rd
-ad48b24429d673e1af3120d0cf6c3eb3 *man/vegdist.Rd
+b860be7be28c20670c11ae7adb686dea *man/vegdist.Rd
 f5910df140a9fc0a290d0a9813b00825 *man/vegemite.Rd
 c3209a8eff0fe638d3a43b25ea5bec16 *man/wascores.Rd
 e8085b39e46823189e312a5776835adc *man/wcmdscale.Rd
@@ -596,13 +597,14 @@ d706ad17bf9aaeab00cead307aeb2d3a *src/cepin.f
 dd22a1632081402e62320a4c0d6b2aa9 *src/data2hill.c
 6f93283e7eba742ef97d0eb323db28eb *src/decorana.f
 87b05dd087e591f1f8e92ecbf1983207 *src/goffactor.c
+0c5e00ee40885dbe505fba05dca63fa5 *src/init.c
 6edc5b9813b7a8545ff411295b2020d2 *src/monoMDS.f
 8e52305b02e176e1e2979235d311efb7 *src/nestedness.c
 77acc57d3a8492c99c324a4c4e585378 *src/ordering.f
 31bdbe9b08340e1662a62cf6e61ade6a *src/pnpoly.c
 b9b647fcf8a3e59e10b9351fae60ec06 *src/stepacross.c
-bdd7c52a5c8aa1ae167f2a7924eae507 *src/vegdist.c
-5a63786318301497a2ff53b27afd94e9 *vignettes/FAQ-vegan.Rmd
+be1ad1622ebd39dfd68e2aab1f0eedad *src/vegdist.c
+59b920cd88206c7d709034c589fce4aa *vignettes/FAQ-vegan.Rmd
 c910da720c0da49de1808c688a450206 *vignettes/decision-vegan.Rnw
 06cfa11a83ca0330979d500549f2415a *vignettes/diversity-vegan.Rnw
 6b35943a07c04a6afc77222b0e17b7f8 *vignettes/intro-vegan.Rnw
diff --git a/NAMESPACE b/NAMESPACE
index ec2dcf9..9cfbc80 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -20,7 +20,7 @@ ordiarrows, ordiArrowMul, ordiArrowTextXY, ordibar, ordicloud,
 ordicluster, ordiellipse, ordigrid,
 ordihull, ordilabel, ordiplot, ordipointlabel, ordiresids,
 ordisegments, ordispider, ordisplom, ordistep, ordisurf,
-orditkplot, orditorp, ordixyplot,
+orditkplot, orditorp, ordixyplot, ordiYbar,
 pcnm, permatfull, permatswap, permustats, permutest,
 poolaccum, postMDS, prc, prestondistr, prestonfit, procrustes,
 protest, radfit, radlattice, rankindex, rarefy, rarecurve, rareslope,
diff --git a/R/anova.ccabyterm.R b/R/anova.ccabyterm.R
index 84cf30c..4ef4a43 100644
--- a/R/anova.ccabyterm.R
+++ b/R/anova.ccabyterm.R
@@ -165,7 +165,7 @@
         object <- update(object, subset = object$subset)
     }
     LC <- as.data.frame(LC)
-    fla <- reformulate(names(LC))
+    fla <- formula(object)
     Pvals <- rep(NA, ncol(LC))
     F.perm <- matrix(ncol = ncol(LC), nrow = nperm)
     environment(object$terms) <- environment()
@@ -176,10 +176,17 @@
         Df <- Df[seq_len(ncol(LC))]
         Fstat <- Fstat[seq_len(ncol(LC))]
     }
+    axnams <- colnames(LC)
+    mf <- model.frame(object)
+    LC <- cbind(mf, LC)
     for (i in seq_along(eig)) {
-        part <- paste("~ . +Condition(",
-                      paste(names(LC)[-i], collapse = "+"), ")")
-        upfla <- update(fla, part)
+        if (i > 1) {
+            part <- paste("~ . +Condition(",
+                          paste(axnams[seq_len(i-1)], collapse = "+"), ")")
+            upfla <- update(fla, part)
+        } else {
+            upfla <- fla
+        }
         ## only one axis, and cannot partial out?
         if (length(eig) == 1)
             mod <- permutest(object, permutations, model = model,
@@ -188,7 +195,7 @@
             mod <-
                 permutest(update(object, upfla, data = LC),
                           permutations, model = model,
-                          parallel = parallel)
+                          parallel = parallel, first = TRUE)
         Pvals[i] <- (sum(mod$F.perm >= mod$F.0 - EPS) + 1) / (nperm + 1)
         F.perm[ , i] <- mod$F.perm
         if (Pvals[i] > cutoff)
@@ -207,7 +214,7 @@
     colnames(out) <- c("Df", varname, "F", "Pr(>F)")
     head <- paste0("Permutation test for ", object$method, " under ",
                    model, " model\n",
-                   "Marginal tests for axes\n",
+                   "Forward tests for axes\n",
                    howHead(attr(permutations, "control")))
     mod <- paste("Model:", c(object$call))
     attr(out, "heading") <- c(head, mod)
diff --git a/R/as.mlm.cca.R b/R/as.mlm.cca.R
index 86e3e46..a447374 100644
--- a/R/as.mlm.cca.R
+++ b/R/as.mlm.cca.R
@@ -1,10 +1,12 @@
 `as.mlm.cca` <-
-    function (x) 
+    function (x)
 {
     w <- x$rowsum
-    wa <- x$CCA$wa
-    wa <- sweep(wa, 1, sqrt(w), "*")
+    WA <- x$CCA$wa
     X <- qr.X(x$CCA$QR)
-    lm(wa ~ . - 1, data = as.data.frame(X))
+    ## shall use weighted regression: deweight X
+    X <- (1/sqrt(w)) * X
+    X <- as.data.frame(X)
+    lm(WA ~ ., data = X, weights = w)
 }
 
diff --git a/R/as.mlm.rda.R b/R/as.mlm.rda.R
index 2d789cd..ffe4cb5 100644
--- a/R/as.mlm.rda.R
+++ b/R/as.mlm.rda.R
@@ -1,7 +1,8 @@
 `as.mlm.rda` <-
-    function (x) 
+    function (x)
 {
-    X <- qr.X(x$CCA$QR)
-    lm(x$CCA$wa ~ . - 1, data = as.data.frame(X))
+    X <- as.data.frame(qr.X(x$CCA$QR))
+    WA <- x$CCA$wa
+    lm(WA ~ . , data = X)
 }
 
diff --git a/R/biplot.rda.R b/R/biplot.rda.R
index 7661a08..9e9761a 100644
--- a/R/biplot.rda.R
+++ b/R/biplot.rda.R
@@ -25,7 +25,7 @@
   if (length(col) == 1)
       col <- c(col,col)
   g <- scores(x, choices = choices, display = display,
-              scaling = scaling, const)
+              scaling = scaling, correlation = correlation, const)
   if (!is.list(g)) {
       g <- list(default = g)
       names(g) <- display
diff --git a/R/cca.default.R b/R/cca.default.R
index 28deb44..4b6e5b9 100644
--- a/R/cca.default.R
+++ b/R/cca.default.R
@@ -82,8 +82,10 @@
             oo <- oo[1:qrank]
             if (length(oo) < ncol(Y.r))
                 CCA$alias <- colnames(Y.r)[-oo]
-            CCA$biplot <- cor(Y.r[, oo, drop = FALSE], sol$u[,
-                                        1:rank, drop = FALSE])
+            ## cor() re-centres Y.r & u: use crossprod() of cor equation
+            xx <- Y.r[, oo, drop = FALSE]
+            CCA$biplot <- (1/sqrt(colSums(xx^2))) *
+                crossprod(xx, sol$u[, seq_len(rank), drop = FALSE])
             CCA$rank <- rank
             CCA$qrank <- qrank
             CCA$tot.chi <- sum(CCA$eig)
diff --git a/R/envfit.default.R b/R/envfit.default.R
index d6cf815..398b893 100644
--- a/R/envfit.default.R
+++ b/R/envfit.default.R
@@ -1,6 +1,6 @@
 `envfit.default` <-
     function (ord, env, permutations = 999, strata = NULL, choices = c(1, 2),
-             display = "sites", w = weights(ord), na.rm = FALSE, ...)
+             display = "sites", w = weights(ord, display), na.rm = FALSE, ...)
 {
     weights.default <- function(object, ...) NULL
     w < eval(w)
diff --git a/R/inertcomp.R b/R/inertcomp.R
index c3acc1d..5265f7c 100644
--- a/R/inertcomp.R
+++ b/R/inertcomp.R
@@ -31,7 +31,7 @@
     else {
         nr <- 1
     }
-    if (!is.null(pCCA)) {
+    if (!is.null(pCCA) && object$pCCA$rank > 0) {
         if (display == "sites")
             pCCA <- t(pCCA)
         if (inherits(object, "dbrda"))
@@ -39,10 +39,10 @@
         else
             pCCA <- diag(crossprod(pCCA))/nr
     }
-    if (!is.null(CCA))
+    if (!is.null(CCA) && object$CCA$rank > 0)
         CCA <- rowSums(diag(w, length(w)) %*% CCA^2 %*%
                            diag(object$CCA$eig, length(object$CCA$eig)))
-    if (!is.null(CA))
+    if (!is.null(CA) && object$CA$rank > 0)
         CA <- rowSums(diag(w, length(w)) %*% CA^2 %*%
                           diag(object$CA$eig, length(object$CA$eig)))
     out <- cbind(pCCA, CCA, CA)
diff --git a/R/intersetcor.R b/R/intersetcor.R
index 9a4931b..40e2dc4 100644
--- a/R/intersetcor.R
+++ b/R/intersetcor.R
@@ -3,16 +3,21 @@
 {
     if (!inherits(object, "cca"))
         stop("can be used only with objects inheriting from 'cca'")
-    if (is.null(object$CCA))
-        stop("can be used only with constrained ordination")
+    if (is.null(object$CCA) || !object$CCA$rank)
+        stop("no constrained ordination or rank of constraints is zero")
     wa <- object$CCA$wa
     X <- qr.X(object$CCA$QR)
+    ## remove conditions (partial terms)
+    if (!is.null(object$pCCA)) {
+        X <- X[, -seq_along(object$pCCA$envcentre), drop = FALSE]
+        X <- qr.resid(object$pCCA$QR, X)
+    }
     if (inherits(object, "rda"))
         cor(X, wa)
-    else { # cca
-        w <- object$rowsum
-        cov <- crossprod(X, sqrt(w) * wa)
-        sd <- outer(1/sqrt(colSums(X^2)), 1/sqrt(colSums(w * wa^2)))
-        cov * sd
+    else { # cca: weighted analysis, terms already weighted-centred
+        wa <- sqrt(object$rowsum) * wa
+        cov <- crossprod(X, wa)
+        isd <- outer(1/sqrt(colSums(X^2)), 1/sqrt(colSums(wa^2)))
+        cov * isd
     }
 }
diff --git a/R/ordiParseFormula.R b/R/ordiParseFormula.R
index 84af261..f7b9721 100644
--- a/R/ordiParseFormula.R
+++ b/R/ordiParseFormula.R
@@ -15,7 +15,8 @@ function (formula, data, xlev = NULL, na.action = na.fail,
     formula[[2]] <- NULL
     if (!is.null(indPartial)) {
         partterm <- attr(Terms, "variables")[1 + indPartial]
-        Pterm <- sapply(partterm, function(x) deparse(x[[2]], width.cutoff=500))
+        Pterm <- sapply(partterm, function(x)
+            deparse(x[[2]], width.cutoff=500, backtick = TRUE))
         Pterm <- paste(Pterm, collapse = "+")
         P.formula <- as.formula(paste("~", Pterm), env = environment(formula))
         zlev <- xlev[names(xlev) %in% Pterm]
@@ -25,8 +26,9 @@ function (formula, data, xlev = NULL, na.action = na.fail,
                  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, 
+        partterm <- sapply(partterm, function(x)
+            deparse(x, width.cutoff=500, backtick = TRUE))
+        formula <- update(formula, paste("~.-", paste(partterm,
             collapse = "-")))
         flapart <- update(formula, paste(" ~ . +", Pterm))
     }
@@ -90,10 +92,15 @@ function (formula, data, xlev = NULL, na.action = na.fail,
     }
     if (NROW(mf) > 0) {
         Y <- model.matrix(formula, mf)
+        ## save assign attribute
+        assign <- attr(Y, "assign")
+        assign <- assign[assign > 0]
         if (any(colnames(Y) == "(Intercept)"))
             Y <- Y[, -which(colnames(Y) == "(Intercept)"), drop = FALSE]
         if (NCOL(Y) == 0)
             Y <- NULL
+        else
+            attr(Y, "assign") <- assign
     }
     X <- as.matrix(X)
     rownames(X) <- rownames(X, do.NULL = FALSE)
diff --git a/R/ordiR2step.R b/R/ordiR2step.R
index 6608a02..852c3bf 100644
--- a/R/ordiR2step.R
+++ b/R/ordiR2step.R
@@ -3,15 +3,18 @@
 ### Blanchet, Legendre & Borcard: Ecology 89, 2623--2623; 2008.
 
 `ordiR2step` <-
-    function(object, scope, direction = c("both", "forward"),
-             Pin = 0.05, R2scope = TRUE, permutations = how(nperm=499),
+    function(object, scope, Pin = 0.05, R2scope = TRUE,
+             permutations = how(nperm=499),
              trace = TRUE, R2permutations = 1000, ...)
 {
-    direction <- match.arg(direction)
     if (is.null(object$terms))
         stop("ordination model must be fitted using formula")
     if (missing(scope))
         stop("needs scope")
+    if (inherits(scope, "cca"))
+        scope <- delete.response(formula(scope))
+    if (!inherits(scope, "formula"))
+        scope <- reformulate(scope)
     ## Get R2 of the original object
     if (is.null(object$CCA))
         R2.0 <- 0
@@ -24,17 +27,13 @@
     if (is.null(scope) || !length(add.scope(object, scope)))
         stop("needs upper 'scope': no terms can be added")
     ## Get R2 of the scope
-    if (inherits(scope, "rda")) 
-        scope <- delete.response(formula(scope))
-    if (!inherits(scope, "formula"))
-        scope <- reformulate(scope)
     if (R2scope)
-        R2.all <- RsquareAdj(update(object, scope),
+        R2.all <- RsquareAdj(update(object, delete.response(formula(scope))),
                              permutations = R2permutations, ...)
     else
         R2.all <- list(adj.r.squared = NA)
     ## Check that the full model can be evaluated
-    if (is.na(R2.all$adj.r.squared) && R2scope) 
+    if (is.na(R2.all$adj.r.squared) && R2scope)
         stop("the upper scope cannot be fitted (too many terms?)")
     R2.all <- R2.all$adj.r.squared
     ## Collect data to anotab returned as the 'anova' object
@@ -42,24 +41,18 @@
     ## Step forward and continue as long as R2.adj improves and R2.adj
     ## remains below R2.adj < R2.all
     R2.previous <- R2.0
-    drops <- NULL
     repeat {
         if (trace) {
             cat("Step: R2.adj=", R2.previous, "\n")
             cat(pasteCall(formula(object)), "\n")
         }
         adds <- add.scope(object, scope)
-        if (direction == "both")
-            drops <- drop.scope(object)
-        ## Nothing to add or drop, and we're done: break
-        if (length(adds) == 0 && length(drops) == 0)
+        ## Nothing to add and we're done: break
+        if (length(adds) == 0)
             break
-        R2.adds <- numeric(length(adds) + length(drops))
-        if (length(adds))
-            adds <- paste("+", adds)
-        if (length(drops))
-            drops <- paste("-", drops)
-        names(R2.adds) <- c(adds, drops) 
+        R2.adds <- numeric(length(adds))
+        adds <- paste("+", adds)
+        names(R2.adds) <- adds
         ## Loop over add scope
         for (trm in seq_along(R2.adds)) {
             fla <- paste(". ~ .", names(R2.adds[trm]))
@@ -82,7 +75,7 @@
         ## First criterion: R2.adj improves and is still lower or
         ## equal than for the full model of the scope
         if (R2.adds[best] > R2.previous &&
-            if (R2scope) R2.adds[best] <= R2.all else TRUE) {
+            (!R2scope || R2scope && R2.adds[best] <= R2.all)) {
             ## Second criterion: added variable is significant
             tst <- add1(object, scope = adds[best], test="permu",
                         permutations = permutations,
@@ -91,19 +84,23 @@
                 print(tst[-1,])
                 cat("\n")
             }
-            if (tst[,"Pr(>F)"][2] > Pin)
+            if (tst[,"Pr(>F)"][2] <= Pin) {
+                fla <- paste("~  .", names(R2.adds[best]))
+                object <-  update(object, fla)
+            } else
                 break
-            fla <- paste("~  .", adds[best])
-            object <- update(object, fla)
-            R2.previous <- RsquareAdj(object,
-                                      permutations = R2permutations, ...)$adj.r.squared
-            anotab <- rbind(anotab, cbind("R2.adj" = R2.previous, tst[2,]))
         } else {
             break
         }
+        R2.previous <- RsquareAdj(object,
+                                  permutations = R2permutations,
+                                  ...)$adj.r.squared
+            anotab <- rbind(anotab,
+                            cbind("R2.adj" = R2.previous, tst[2,]))
     }
-    if (NROW(anotab) > 0) {
-        anotab <- rbind(anotab, "<All variables>" = c(R2.all, rep(NA, 4)))
+    if (NROW(anotab)) {
+        if (R2scope)
+            anotab <- rbind(anotab, "<All variables>" = c(R2.all, rep(NA, 4)))
         class(anotab) <- c("anova", class(anotab))
         object$anova <- anotab
     }
diff --git a/R/ordiTerminfo.R b/R/ordiTerminfo.R
index 58ddcc0..f4ebfd8 100644
--- a/R/ordiTerminfo.R
+++ b/R/ordiTerminfo.R
@@ -1,4 +1,4 @@
-"ordiTerminfo" <-
+`ordiTerminfo` <-
     function(d, data)
 {
     Terms <- delete.response(d$terms.expand)
@@ -8,5 +8,6 @@
         mf <- d$modelframe
     xlev <- .getXlevels(Terms, mf)
     ordered <- sapply(mf, is.ordered)
-    list(terms = Terms, xlev = xlev, ordered = ordered)
+    assign <- attr(d$Y, "assign")
+    list(terms = Terms, assign = assign, xlev = xlev, ordered = ordered)
 }
diff --git a/R/ordiYbar.R b/R/ordiYbar.R
new file mode 100644
index 0000000..277de9e
--- /dev/null
+++ b/R/ordiYbar.R
@@ -0,0 +1,123 @@
+#' Extract internal working matrices from constrained ordination object
+#'
+#' Function extract internal working matrices from the constrained
+#' ordination object (class \code{"cca"}) in \pkg{vegan}. The function
+#' returns only one model matrix type, but there is no overlap between
+#' elements of typical request.
+#'
+#' @param x ordination object
+#' @param model model to be extracted
+#'
+`ordiYbar` <-
+    function(x, model = c("CCA", "CA", "pCCA", "partial", "initial"))
+{
+    model <- match.arg(model)
+    isDB <- inherits(x, "dbrda")
+    if (!is.null(x$Ybar))
+        Ybar <- x$Ybar
+    else
+        return(vegan24Xbar(x, model))
+    if (model == "initial")
+        return(Ybar)
+    ## return NULL for missing elements
+    if (model != "partial")
+        if(is.null(x[[model]]))
+            return(NULL)
+
+    ## edit Ybar -- not yet dbrda
+    switch(model,
+    "pCCA" = {
+        Ybar <- qr.fitted(x$pCCA$QR, Ybar)
+        if (isDB)
+            Ybar <- qr.fitted(x$pCCA$QR, t(Ybar))
+    },
+    "partial" = {
+        if (!is.null(x$pCCA)) {
+            Ybar <- qr.resid(x$pCCA$QR, Ybar)
+            if (isDB)
+                Ybar <- qr.resid(x$pCCA$QR, t(Ybar))
+        }
+    },
+    "CCA" = {
+        if (!is.null(x$pCCA)) {
+            Ybar <- qr.resid(x$pCCA$QR, Ybar)
+            if (isDB)
+                Ybar <- qr.resid(x$pCCA$QR, t(Ybar))
+        }
+        Ybar <- qr.fitted(x$CCA$QR, Ybar)
+        if (isDB)
+            Ybar <- qr.fitted(x$CCA$QR, t(Ybar))
+    },
+    "CA" = {
+        if (!is.null(x$CCA)) {
+            Ybar <- qr.resid(x$CCA$QR, Ybar)
+            if (isDB)
+                Ybar <- qr.resid(x$CCA$QR, t(Ybar))
+        }
+        else if (!is.null(x$pCCA)) {
+            Ybar <- qr.resid(x$pCCA$QR, Ybar)
+            if (isDB)
+                Ybar <- qr.resid(x$pCCA$QR, t(Ybar))
+        }
+    })
+    Ybar
+}
+
+#' Extract internal working matrices of cca objects for vegan 2.4
+
+`vegan24Xbar` <-
+    function(x, model = c("CCA", "CA", "pCCA", "partial", "initial"))
+{
+    model <- match.arg(model)
+    ## return NULL for missing elements
+    if (model %in% c("CCA", "CA", "pCCA"))
+        if(is.null(x[[model]]))
+            return(NULL)
+    Ybar <- NULL
+    ## initial working data is not saved and must be reconstructed in
+    ## partial models, but this cannot be done in all cases.
+    if (model == "initial") {
+        if (inherits(x, "dbrda")) {
+            ## NULL in partial models
+            if (is.null(x$pCCA)) {
+                Ybar <- x$CCA$Xbar
+                if (is.null(Ybar))
+                    Ybar <- x$CA$Xbar
+            }
+        } else {
+            ## this will ignore imaginary components in capscale
+            if (is.null(x$CCA))
+                Ybar <- x$CA$Xbar
+            else
+                Ybar <- x$CCA$Xbar
+            if (!is.null(x$pCCA))
+                Ybar <- Ybar + x$pCCA$Fit
+        }
+        ## vegan 2.5 compatibility: returns Ybar divided with d.o.f.
+        if (x$inertia == "variance")
+            Ybar <- Ybar/sqrt(nobs(x)-1)
+        return(Ybar)
+    }
+    ## several components are already stored in the result object and
+    ## we just fetch those (only CCA needs work)
+    switch(model,
+    "pCCA" =
+        Ybar <- x$pCCA$Fit,
+    "partial" = {
+        Ybar <- x$CCA$Xbar
+        if (is.null(Ybar))
+            Ybar <- x$CA$Xbar
+    },
+    "CCA" = {
+        Ybar <- qr.fitted(x$CCA$QR, x$CCA$Xbar)
+        if (inherits(x, "dbrda"))
+            Ybar <- qr.fitted(x$CCA$QR, t(Ybar))
+    },
+    "CA" =
+        Ybar <- x$CA$Xbar
+    )
+    ## vegan 2.5 divides Ybar with sqrt(n-1) in rda for variance
+    if (x$inertia == "variance")
+        Ybar <- Ybar/sqrt(nobs(x)-1)
+    Ybar
+}
diff --git a/R/ordispider.R b/R/ordispider.R
index 2fb24c7..5523b7d 100644
--- a/R/ordispider.R
+++ b/R/ordispider.R
@@ -8,8 +8,11 @@
     if (inherits(ord, "cca") && missing(groups)) {
         lc <- scores(ord, display = "lc", ...)
         wa <- scores(ord, display = "wa", ...)
+        if (is.null(col))
+            col <- par("fg")
         ordiArgAbsorber(lc[, 1], lc[, 2], wa[, 1], wa[, 2],
-                        FUN = segments, ...)
+                        FUN = segments, col = col, lty = lty, lwd = lwd,
+                        ...)
         class(lc) <- "ordispider"
         return(invisible(lc))
     }
@@ -36,9 +39,9 @@
         warning("weights are ignored with 'median' spiders")
     out <- seq(along = groups)
     inds <- names(table(groups))
-    if (label) 
+    if (label)
     cntrs <- names <- NULL
-    
+
     ## fill in graphical vectors with default values if unspecified
     ## and recycles shorter vectors
     for(arg in c("col","lty","lwd")) {
@@ -75,7 +78,7 @@
             }
         }
     }
-    if (label) 
+    if (label)
         ordiArgAbsorber(cntrs, label = names, FUN = ordilabel, ...)
     spids <- t(spids)
     class(spids) <- "ordispider"
diff --git a/R/ordisurf.R b/R/ordisurf.R
index b0548d9..cdeeac9 100644
--- a/R/ordisurf.R
+++ b/R/ordisurf.R
@@ -18,10 +18,11 @@
 `ordisurf.default` <-
     function (x, y, choices = c(1, 2), knots = 10, family = "gaussian",
               col = "red", isotropic = TRUE, thinplate = TRUE, bs = "tp",
-              fx = FALSE, add = FALSE, display = "sites", w = weights(x),
-              main, nlevels = 10, levels, npoints = 31, labcex = 0.6,
-              bubble = FALSE, cex = 1, select = TRUE, method = "REML",
-              gamma = 1, plot = TRUE, lwd.cl = par("lwd"), ...)
+              fx = FALSE, add = FALSE, display = "sites",
+              w = weights(x, display), main, nlevels = 10, levels,
+              npoints = 31, labcex = 0.6, bubble = FALSE, cex = 1,
+              select = TRUE, method = "REML", gamma = 1, plot = TRUE,
+              lwd.cl = par("lwd"), ...)
 {
     weights.default <- function(object, ...) NULL
     if(!missing(thinplate)) {
diff --git a/R/orditkplot.R b/R/orditkplot.R
index 91b6e7f..b2d59be 100644
--- a/R/orditkplot.R
+++ b/R/orditkplot.R
@@ -166,7 +166,7 @@
                        file=tcltk::tkgetSaveFile(
                          filetypes="{{EPS file} {.eps}}",
                          defaultextension=".eps")))
-    dismiss <- tcltk::tkbutton(buts, text="Dismiss",
+    dismiss <- tcltk::tkbutton(buts, text="Close",
                                command=function() tcltk::tkdestroy(w))
     ## Dump current plot to an "orditkplot" object (internally)
     ordDump <- function() {
@@ -206,25 +206,25 @@
         tcltk::tkgrid(entryDump, pady="5m")
         isDone <- function() {
             dumpName <- tcltk::tclvalue(dumpVar)
-            if (exists(dumpName, envir=.GlobalEnv)) {
+            if (exists(dumpName, envir = parent.frame())) {
                 ok <- tcltk::tkmessageBox(message=paste(sQuote(dumpName),
                                    "exists.\nOK to overwrite?"),
                                    icon="warning", type="okcancel",
                                    default="ok")
                 if(tcltk::tclvalue(ok) == "ok") {
-                    assign(dumpName, xy, envir=.GlobalEnv)
+                    assign(dumpName, xy, envir = parent.frame())
                     tcltk::tkdestroy(tt)
                 }
             }
             else {
-                assign(dumpName, xy, envir=.GlobalEnv)
+                assign(dumpName, xy, envir = parent.frame())
                 tcltk::tkdestroy(tt)
             }
         }
         tcltk::tkbind(entryDump, "<Return>", isDone)
         tcltk::tkfocus(tt)
     }
-    dump <- tcltk::tkbutton(buts, text="Dump to R", command=pDump)
+    dump <- tcltk::tkbutton(buts, text="Save to R", command=pDump)
     ## Button to write current "orditkplot" object to a graphical device
     devDump <- function() {
         xy <- ordDump()
diff --git a/R/plot.meandist.R b/R/plot.meandist.R
index b3baafa..2b805ea 100644
--- a/R/plot.meandist.R
+++ b/R/plot.meandist.R
@@ -1,6 +1,6 @@
 `plot.meandist` <-
     function(x, kind = c("dendrogram", "histogram"),  cluster = "average", ylim,
-             axes = TRUE, ...) 
+             axes = TRUE, ...)
 {
     kind <- match.arg(kind)
     n <- attr(x, "n")
@@ -20,7 +20,7 @@
         pos <- ifelse(w < tr, 1, 3)
         pos[is.na(pos)] <- 1
         w[is.na(w)] <- tr[is.na(w)]
-        text(seqw, w, labels = labels(cl), pos = pos, srt = 0)
+        text(seqw, w, labels = labels(cl), pos = pos, srt = 0, xpd = TRUE, ...)
     } else {
         w <- diag(x)
         seqw <- seq_along(w)
diff --git a/R/spenvcor.R b/R/spenvcor.R
index 3ba6643..9a9c0c7 100644
--- a/R/spenvcor.R
+++ b/R/spenvcor.R
@@ -1,5 +1,5 @@
 `spenvcor` <-
-    function (object) 
+    function (object)
 {
     if (is.null(object$CCA))
         stop("Needs results from constrained ordination")
@@ -7,9 +7,11 @@
     wa <- object$CCA$wa
     if (!inherits(object, "rda")) { # is CCA
         r <- sqrt(object$rowsum)
-        u <- sweep(u, 1, r, "*")
-        wa <- sweep(wa, 1, r, "*")
+        u <- r * u
+        wa <- r * wa
     }
-    diag(cor(u, wa))
+    ## because colSums(u*u) = 1, we can simplify diag(cor(u, wa)) --
+    ## and we must for weighted CA
+    colSums(u * wa)/sqrt(colSums(wa^2))
 }
 
diff --git a/R/summary.cca.R b/R/summary.cca.R
index 7f5f274..829fa8f 100644
--- a/R/summary.cca.R
+++ b/R/summary.cca.R
@@ -12,7 +12,7 @@
     ## scaling is stored in return object so must be in numeric format
     scaling <- scalingType(scaling = scaling, correlation = correlation,
                            hill = hill)
-    if (axes && length(display) && (!is.na(display) && !is.null(display))) 
+    if (axes && length(display) && (!is.na(display) && !is.null(display)))
         summ <- scores(object, scaling = scaling, choices = 1:axes, display = display,
                        ...)
     ## scores() drops list to a matrix if there is only one item: workaround below.
@@ -39,7 +39,7 @@
     summ$constr.chi <- object$CCA$tot.chi
     summ$unconst.chi <- object$CA$tot.chi
     summ$cont <- summary(eigenvals(object))
-    if (!is.null(object$CCA))
+    if (!is.null(object$CCA) && object$CCA$rank > 0)
         summ$concont <- summary(eigenvals(object, constrained = TRUE))
     summ$ev.head <- c(summ$ev.con, summ$ev.uncon)[seq_len(axes)]
     summ$scaling <- scaling
diff --git a/R/tolerance.cca.R b/R/tolerance.cca.R
index bd43894..d6deb59 100644
--- a/R/tolerance.cca.R
+++ b/R/tolerance.cca.R
@@ -33,8 +33,10 @@ tolerance.cca <- function(x, choices = 1:2,
     if(missing(which)) {
         which <- "species"
     }
+    ## zapping epsilon to make approximate 1's into 1's
+    ZAP <- sqrt(.Machine$double.eps)
     ## reconstruct species/response matrix Y - up to machine precision!
-    partialFit <- ifelse(is.null(x$pCCA$Fit), 0, x$pCCA$Fit)
+    partialFit <- if(is.null(x$pCCA$Fit)) 0 else x$pCCA$Fit
     if (is.null(x$CCA)) {
         Xbar <- x$CA$Xbar
     } else {
@@ -62,6 +64,9 @@ tolerance.cca <- function(x, choices = 1:2,
         for (i in seq_len(NROW(res))) {
             XiUk <- apply(scrs[["species"]], 1L, `-`, scrs[[siteScrs]][i,])
             YXiUk <- sweep(XiUk^2, 2L, Y[i,], "*")
+            if(any(neg <- YXiUk < 0)) {
+                YXiUk[neg] <- 0
+            }
             res[i, ] <- sqrt(rowSums(YXiUk) / Ytot[i])
         }
         rownames(res) <- rownames(scrs[[siteScrs]])
@@ -70,7 +75,10 @@ tolerance.cca <- function(x, choices = 1:2,
         if(doN2) {
             y <- sweep(Y, 1, Ytot, "/")^2
             N2 <- 1 / rowSums(y, na.rm = TRUE) ## 1/H
-            res <- sweep(res, 1, sqrt(1 - (1/N2)), "/")
+            ## avoid almost-1 for sites with only one spp
+            N2[abs(N2-1) < ZAP] <- 1
+            ## avoid "negative zeros" form 1 - 1/N2 when N2 ~ 1
+            res <- sweep(res, 1, sqrt(pmax(1 - 1/N2, 0)), "/")
         }
     } else {
         res <- matrix(ncol = length(choices), nrow = ncol(Y))
@@ -78,6 +86,9 @@ tolerance.cca <- function(x, choices = 1:2,
         for (i in seq_len(NROW(res))) {
             XiUk <- apply(scrs[[siteScrs]], 1L, `-`, scrs[["species"]][i,])
             YXiUk <- sweep(XiUk^2, 2L, Y[,i], "*")
+            if (any(neg <- YXiUk < 0)) {
+                YXiUk[neg] <- 0
+            }
             res[i, ] <- sqrt(rowSums(YXiUk) / Ytot[i])
         }
         rownames(res) <- colnames(Y)
@@ -86,10 +97,14 @@ tolerance.cca <- function(x, choices = 1:2,
         if(doN2) {
             y <- sweep(Y, 2, Ytot, "/")^2
             N2 <- 1 / colSums(y, na.rm = TRUE) # 1/H
-            res <- sweep(res, 1, sqrt(1 - (1/N2)), "/")
+            ## avoid almost-1 for species present only once
+            N2[abs(N2-1) < ZAP] <- 1
+            ## avoid "negative zeros" form 1 - 1/N2 when N2 ~ 1
+            res <- sweep(res, 1, sqrt(pmax(1 - 1/N2, 0)), "/")
         }
     }
-    res[is.infinite(res)] <- 0 # some values can be Inf but are really 0
+    res[!is.finite(res)] <- 0 # some values can be Inf or NaN but are really 0
+    res[res < sqrt(.Machine$double.eps)] <- 0 # almost-zero tolerances should be zero
     class(res) <- c("tolerance.cca", "tolerance","matrix")
     attr(res, "which") <- which
     attr(res, "scaling") <- scaling
diff --git a/R/veganMahatrans.R b/R/veganMahatrans.R
index 1a86bf2..62bd023 100644
--- a/R/veganMahatrans.R
+++ b/R/veganMahatrans.R
@@ -7,14 +7,13 @@
 ### input must be correct: 'x' must be a centred matrix (not a
 ### data.frame, not raw data).
 `veganMahatrans` <-
-    function (x, s2, tol = 1e-8) 
+    function (x, s2, tol = sqrt(.Machine$double.eps))
 {
-    n <- nrow(x)
     if (missing(s2))
-        s2 <- cov(x) 
+        s2 <- cov(x)
     e <- eigen(s2, symmetric = TRUE)
-    k <- e$values > tol
+    k <- e$values > tol * e$values[1L]
     sisqr <- e$vectors[,k, drop=FALSE] %*%
         (sqrt(1/e$values[k]) * t(e$vectors[,k, drop = FALSE]))
-    x %*% sisqr 
+    x %*% sisqr
 }
diff --git a/R/vegdist.R b/R/vegdist.R
index 4f442f4..fb97be0 100644
--- a/R/vegdist.R
+++ b/R/vegdist.R
@@ -18,7 +18,8 @@
     if (!method %in% c(1,2,6,16) && any(rowSums(x, na.rm = TRUE) == 0))
         warning("you have empty rows: their dissimilarities may be meaningless in method ",
                 dQuote(inm))
-    if (!method %in% c(1,2,6,16) && any(x < 0, na.rm = TRUE))
+    ## 1 manhattan, 2 euclidean, 3 canberra, 6 gower, 16 mahalanobis
+    if (!method %in% c(1,2,3,6,16) && any(x < 0, na.rm = TRUE))
         warning("results may be meaningless because data have negative entries in method ",
                 dQuote(inm))
     if (method == 11 && any(colSums(x) == 0)) 
diff --git a/build/partial.rdb b/build/partial.rdb
index c08a061..63c2e11 100644
Binary files a/build/partial.rdb and b/build/partial.rdb differ
diff --git a/build/vignette.rds b/build/vignette.rds
index a06e18a..2a430c8 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd
index a3611f2..20c3a31 100644
--- a/inst/NEWS.Rd
+++ b/inst/NEWS.Rd
@@ -1,7 +1,121 @@
- \name{NEWS}
+\name{NEWS}
 \title{vegan News}
 \encoding{UTF-8}
 
+\section{Changes in version 2.4-4}{
+
+  \subsection{INSTALLATION AND BUILDING}{
+    \itemize{
+
+      \item \code{orditkplot} should no longer give warnings in CRAN
+      tests.
+
+    } %itemize
+  } % installatin and building
+  
+  \subsection{BUG FIXES}{
+    \itemize{
+
+      \item \code{anova(..., by = "axis")} for constrained ordination
+      (\code{cca}, \code{rda}, \code{dbrda}) ignored partial terms in
+      \code{Condition()}.
+      
+      \item \code{inertcomp} and \code{summary.cca} failed if the
+      constrained component was defined, but explained nothing and had
+      zero rank. See StackOverflow:
+      \href{https://stackoverflow.com/questions/43683699/}{R - Error
+      message in doing RDA analysis - vegan package}.
+
+      \item Labels are no longer cropped in the \code{meandist} plots.
+
+
+    } % itemize
+  } % bug fixes
+  
+  \subsection{NEW FEATURES}{
+    \itemize{
+
+      \item The significance tests for the axes of constrained
+      ordination use now forward testing strategy. More extensive
+      analysis indicated that the previous marginal tests were biased.
+      This is in conflict with Legendre, Oksanen & ter Braak,
+      \emph{Methods Ecol Evol} \strong{2,} 269--277 (2011) who regarded
+      marginal tests as unbiased.
+
+      \item Canberra distance in \code{vegdist} can now handle negative
+      input entries similarly as latest versions of \R.
+
+    } %itemize
+  } % new features
+} % v2.4-4
+
+\section{Changes in version 2.4-3}{
+
+  \subsection{INSTALLATION AND BUILDING}{
+    \itemize{
+
+      \item \pkg{vegan} registers native \bold{C} and \bold{Fortran}
+      routines. This avoids warnings in model checking, and may also
+      give a small gain in speed.
+
+      \item Future versions of \pkg{vegan} will deprecate and remove
+      elements \code{pCCA$Fit}, \code{CCA$Xbar}, and \code{CA$Xbar}
+      from \code{cca} result objects. This release provides a new
+      function \code{ordiYbar} which is able to construct these
+      elements both from the current and future releases. Scripts and
+      functions directly accessing these elements should switch to
+      \code{ordiYbar} for smooth transition.
+
+    } % itemize
+  } % installation
+
+  \subsection{BUG FIXES}{
+    \itemize{
+
+      \item \code{as.mlm} methods for constrained ordination include
+      zero intercept to give the correct residual degrees of freedom for
+      derived statistics.
+
+      \item \code{biplot} method for \code{rda} passes
+      \code{correlation} argument to the scaling algorithm.
+
+      \item Biplot scores were wrongly centred in \code{cca} which
+      caused a small error in their values.
+
+      \item Weighting and centring were corrected in \code{intersetcor}
+      and \code{spenvcor}. The fix can make a small difference when
+      analysing \code{cca} results.
+
+      Partial models were not correctly handled in \code{intersetcor}.
+
+      \item \code{envfit} and \code{ordisurf} functions failed when
+      applied to species scores.
+
+      \item Non-standard variable names can be used within
+      \code{Condition()} in partial ordination.  Partial models are used
+      internally within several functions, and a problem was reported by
+      Albin Meyer (Univ Lorraine, Metz, France) in \code{ordiR2step}
+      when using a variable name that contained a hyphen (which was
+      wrongly interpreted as a minus sign in partial ordination).
+
+      \item \code{ordispider} did not pass graphical arguments when
+      used to show the difference of LC and WA scores in constrained
+      ordination.
+
+      \item \code{ordiR2step} uses only \code{forward} selection to
+      avoid several problems in model evaluation.
+
+      \item \code{tolerance} function could return \code{NaN} in some
+      cases when it should have returned \eqn{0}. Partial models were
+      not correctly analysed. Misleading (non-zero) tolerances were
+      sometimes given for species that occurred only once or sampling
+      units that had only one species.
+
+    } %itemize
+  } % bug fixes
+
+} % 2.4-3
+
 \section{Changes in version 2.4-2}{
   \subsection{BUG FIXES}{
     \itemize{
diff --git a/inst/doc/FAQ-vegan.Rmd b/inst/doc/FAQ-vegan.Rmd
index 3c58581..a29d3fb 100644
--- a/inst/doc/FAQ-vegan.Rmd
+++ b/inst/doc/FAQ-vegan.Rmd
@@ -97,11 +97,11 @@ automatically install sets of most important packages.
 ### What other documentation is available for **vegan**?
 
 **Vegan** is a fully documented R package with standard help pages.
-These are the most authoritative sources of documentation (and as a last
-resource you can use the force and the read the source, as **vegan** is
-open source). **Vegan** package ships with other documents which can be
-read with `vegandocs` command (documented in the **vegan** help). The
-documents included in the **vegan** package are
+These are the most authoritative sources of documentation (and as a
+last resource you can use the force and the read the source, as
+**vegan** is open source). **Vegan** package ships with other
+documents which can be read with `browseVignettes("vegan")`
+command. The documents included in the **vegan** package are
 
 -   **Vegan** `NEWS`
 -   This document (`FAQ-vegan`).
@@ -347,18 +347,15 @@ The scaling or RDA results indeed differ from most other software
 packages. The scaling of RDA is such a complicated issue that it cannot
 be explained in this FAQ, but it is explained in a separate pdf document
 on “Design decision and implementation details in vegan” that you can
-read with **vegan** command `vegandocs("decision")`.
+read with command `browseVignettes("vegan")`.
 
 ------------------------------------------------------------------------
 
 ### cca fails with “data.frame expected” or “"site.env" missing”
 
-This is not a **vegan** error message, but it comes from the `cca`
-function in the **ade4** package. There is an unfortunate name clash,
-and if you have loaded **ade4** after **vegan**, the **ade4** version of
-`cca` will mask the **vegan** version. You can use the **vegan** version
-using command `vegan::cca()`. If you do not need package **ade4**, you
-can detach it with command `detach(package:ade4)`.
+This is not a **vegan** error message, but it comes from an old
+version of the **ade4** package (prior to **ade4** 1.7-8, released Aug
+9, 2017). Upgrade your **ade4**.
 
 ------------------------------------------------------------------------
 
diff --git a/inst/doc/FAQ-vegan.html b/inst/doc/FAQ-vegan.html
index 7c68fd0..132be3e 100644
--- a/inst/doc/FAQ-vegan.html
+++ b/inst/doc/FAQ-vegan.html
@@ -300,11 +300,11 @@ automatically install sets of most important packages.</p>
 <h3>What other documentation is available for <strong>vegan</strong>?</h3>
 
 <p><strong>Vegan</strong> is a fully documented R package with standard help pages.
-These are the most authoritative sources of documentation (and as a last
-resource you can use the force and the read the source, as <strong>vegan</strong> is
-open source). <strong>Vegan</strong> package ships with other documents which can be
-read with <code>vegandocs</code> command (documented in the <strong>vegan</strong> help). The
-documents included in the <strong>vegan</strong> package are</p>
+These are the most authoritative sources of documentation (and as a
+last resource you can use the force and the read the source, as
+<strong>vegan</strong> is open source). <strong>Vegan</strong> package ships with other
+documents which can be read with <code>browseVignettes("vegan")</code>
+command. The documents included in the <strong>vegan</strong> package are</p>
 
 <ul>
 <li>  <strong>Vegan</strong> <code>NEWS</code></li>
@@ -553,18 +553,15 @@ use when they are accessed with <code>scores</code>.</p>
 packages. The scaling of RDA is such a complicated issue that it cannot
 be explained in this FAQ, but it is explained in a separate pdf document
 on “Design decision and implementation details in vegan” that you can
-read with <strong>vegan</strong> command <code>vegandocs("decision")</code>.</p>
+read with command <code>browseVignettes("vegan")</code>.</p>
 
 <hr/>
 
 <h3>cca fails with “data.frame expected” or “"site.env" missing”</h3>
 
-<p>This is not a <strong>vegan</strong> error message, but it comes from the <code>cca</code>
-function in the <strong>ade4</strong> package. There is an unfortunate name clash,
-and if you have loaded <strong>ade4</strong> after <strong>vegan</strong>, the <strong>ade4</strong> version of
-<code>cca</code> will mask the <strong>vegan</strong> version. You can use the <strong>vegan</strong> version
-using command <code>vegan::cca()</code>. If you do not need package <strong>ade4</strong>, you
-can detach it with command <code>detach(package:ade4)</code>.</p>
+<p>This is not a <strong>vegan</strong> error message, but it comes from an old
+version of the <strong>ade4</strong> package (prior to <strong>ade4</strong> 1.7-8, released Aug
+9, 2017). Upgrade your <strong>ade4</strong>.</p>
 
 <hr/>
 
diff --git a/inst/doc/decision-vegan.pdf b/inst/doc/decision-vegan.pdf
index cd949b2..b9a4f2a 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 48ea5bc..fa91079 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 3020cda..5616f30 100644
Binary files a/inst/doc/intro-vegan.pdf and b/inst/doc/intro-vegan.pdf differ
diff --git a/inst/doc/partitioning.pdf b/inst/doc/partitioning.pdf
index 8d1321b..4a65595 100644
Binary files a/inst/doc/partitioning.pdf and b/inst/doc/partitioning.pdf differ
diff --git a/man/MOStest.Rd b/man/MOStest.Rd
index 7e8d613..e305969 100644
--- a/man/MOStest.Rd
+++ b/man/MOStest.Rd
@@ -142,7 +142,7 @@ regression and the Gaussian response model. \emph{Vegetatio} 65,
 \note{ 
 Function \code{fieller.MOStest} is based on package \pkg{optgrad} in
 the Ecological Archives
-(\url{http://www.esapubs.org/archive/ecol/E082/015/default.htm})
+(\url{https://figshare.com/articles/Full_Archive/3521975})
 accompanying Oksanen et al. (2001). The Ecological Archive package
 \pkg{optgrad} also contains profile deviance method for the location
 of the hump or pit, but the current implementation of \code{profile}
diff --git a/man/cca.Rd b/man/cca.Rd
index 9c9f562..589bd6d 100644
--- a/man/cca.Rd
+++ b/man/cca.Rd
@@ -252,7 +252,7 @@
   \code{browseVignettes("vegan")}.
 
   Package \pkg{ade4} provides alternative constrained ordination
-  functions \code{\link[ade4]{cca}} and \code{\link[ade4]{pcaiv}}.
+  function \code{\link[ade4]{pcaiv}}.
 
 }
 
diff --git a/man/cca.object.Rd b/man/cca.object.Rd
index 87520d2..fe59b2e 100644
--- a/man/cca.object.Rd
+++ b/man/cca.object.Rd
@@ -1,5 +1,6 @@
 \name{cca.object}
 \alias{cca.object}
+\alias{ordiYbar} % vegan 2.5-0 documents this in predict.cca.Rd
 
 \title{Result Object from Constrained Ordination with cca, rda or capscale }
 \description{
@@ -73,8 +74,12 @@
     \item{\code{eig}}{Eigenvalues of axes. In \code{CCA} and \code{CA}.}
     \item{\code{envcentre}}{(Weighted) means of the original constraining or
       conditioning variables. In \code{pCCA} and in \code{CCA}.}
-    \item{\code{Fit}}{The fitted values of standardized data matrix after
-      fitting conditions. Only in \code{pCCA}.}
+    \item{\code{Fit}}{The fitted values of standardized data matrix
+      after fitting conditions. Only in \code{pCCA}.  This element
+      will be \bold{deprecated} in the future. Instead of directly
+      accessing this component, you should use
+      \code{ordiYbar(<result>, "pCCA")} which will work both with the
+      current and future releases.}
     \item{\code{QR}}{The QR decomposition of explanatory variables as produced
       by \code{\link{qr}}. 
       The constrained ordination 
@@ -125,14 +130,21 @@
     \item{\code{wa.excluded, u.excluded}}{WA scores for rows removed by
       \code{na.action = na.exclude} in \code{CCA} and \code{CA}
       components if these could be calculated.}
-    \item{\code{Xbar}}{The standardized data matrix after previous stages of
-      analysis. In \code{CCA} this is after possible \code{pCCA} or
-      after partialling out the effects of conditions, and in \code{CA}
-      after both \code{pCCA} and \code{CCA}. In \code{\link{cca}} the
-      standardization is Chi-square, and in \code{\link{rda}} centring
-      and optional scaling by species standard deviations using function
-      \code{\link{scale}}.}
-  }
+
+    \item{\code{Xbar}}{The standardized data matrix after previous
+      stages of analysis. In \code{CCA} this is after possible
+      \code{pCCA} or after partialling out the effects of conditions,
+      and in \code{CA} after both \code{pCCA} and \code{CCA}. In
+      \code{\link{cca}} the standardization is Chi-square, and in
+      \code{\link{rda}} centring and optional scaling by species
+      standard deviations using function \code{\link{scale}}.  This
+      component will be \bold{deprecated} in the future. Instead of
+      directly accessing these components, you should use commands
+      \code{ordiYbar(<result>, "partial")} (for
+      \code{<result>$CCA$Xbar}) or \code{ordiYbar(<result>, "CA")}
+      (for \code{<result>$CA$Xbar}) which will work both in the
+      current and in the future versions of \pkg{vegan}.}
+   }
 }
 }
 
diff --git a/man/envfit.Rd b/man/envfit.Rd
index e14dad1..b4b3e07 100644
--- a/man/envfit.Rd
+++ b/man/envfit.Rd
@@ -17,7 +17,8 @@
 }
 \usage{
 \method{envfit}{default}(ord, env, permutations = 999, strata = NULL, 
-   choices=c(1,2),  display = "sites", w  = weights(ord), na.rm = FALSE, ...)
+   choices=c(1,2),  display = "sites", w  = weights(ord, display),
+   na.rm = FALSE, ...)
 \method{envfit}{formula}(formula, data, ...)
 \method{plot}{envfit}(x, choices = c(1,2), labels, arrow.mul, at = c(0,0), 
    axis = FALSE, p.max = NULL, col = "blue", bg, add = TRUE, ...)
@@ -147,17 +148,16 @@ factorfit(X, P, permutations = 0, strata = NULL, w, ...)
   squares. See \code{\link{permutations}} for additional details on
   permutation tests in Vegan.
 
-  User can supply a vector of prior  weights \code{w}. If the ordination
+  User can supply a vector of prior weights \code{w}. If the ordination
   object has weights, these will be used. In practise this means that
-  the row totals are used as weights with
-  \code{\link{cca}} or \code{\link{decorana}} results. If you do not
-  like this, but want to give 
-  equal weights to all sites, you should set \code{w = NULL}.
-  The weighted fitting gives similar results to biplot
-  arrows and class centroids in \code{\link{cca}}.
-  For complete
-  similarity between fitted vectors and biplot arrows, you should set
-  \code{display = "lc"}.
+  the row totals are used as weights with \code{\link{cca}} or
+  \code{\link{decorana}} results. If you do not like this, but want to
+  give equal weights to all sites, you should set \code{w = NULL}.  The
+  fitted vectors are similar to biplot arrows in constrained ordination
+  only when fitted to LC scores (\code{display = "lc"}) and you set
+  \code{scaling = "species"} (see \code{\link{scores.cca}}).  The
+  weighted fitting gives similar results to biplot arrows and class
+  centroids in \code{\link{cca}}.
 
   The lengths of arrows for fitted vectors are automatically adjusted
   for the physical size of the plot, and the arrow lengths cannot be
diff --git a/man/mso.Rd b/man/mso.Rd
index 286fb88..cf07587 100644
--- a/man/mso.Rd
+++ b/man/mso.Rd
@@ -102,7 +102,7 @@ msoplot(x, alpha = 0.05, explained = FALSE, ylim = NULL, legend = "topleft", ...
   canonical correspondence analysis. \emph{Ecology} 85: 342--351. } 
 \author{ The responsible author was Helene Wagner.} 
 \note{ The function is based on the code published in the Ecological
-  Archives E085-006 (\url{http://www.esapubs.org/archive/ecol/E085/006/default.htm}).  }
+  Archives E085-006 (\url{http://onlinelibrary.wiley.com/doi/10.1890/02-0738/full}).  }
 \seealso{ Function \code{\link{cca}} and \code{\link{rda}},
   \code{\link{cca.object}}. }
 \examples{
diff --git a/man/ordistep.Rd b/man/ordistep.Rd
index f89e683..fac7336 100644
--- a/man/ordistep.Rd
+++ b/man/ordistep.Rd
@@ -18,11 +18,10 @@
 ordistep(object, scope, direction = c("both", "backward", "forward"),
    Pin = 0.05, Pout = 0.1, permutations = how(nperm = 199), steps = 50,
    trace = TRUE, ...)
-ordiR2step(object, scope, direction = c("both", "forward"),
-   Pin = 0.05, R2scope = TRUE, permutations = how(nperm = 499),
-   trace = TRUE, R2permutations = 1000, ...)
+ordiR2step(object, scope, Pin = 0.05, R2scope = TRUE,
+   permutations = how(nperm = 499), trace = TRUE, R2permutations = 1000, ...)
 }
-%- maybe also 'usage' for other objects documented here.
+
 \arguments{
   \item{object}{
   In \code{ordistep}, an ordination object inheriting from \code{\link{cca}} or \code{\link{rda}}. In \code{ordiR2step}, the object must inherit from \code{\link{rda}}, that is, it must have been computed using \code{\link{rda}} or \code{\link{capscale}}.
@@ -36,9 +35,11 @@ ordiR2step(object, scope, direction = c("both", "forward"),
 }
   \item{direction}{
   The mode of stepwise search, can be one of \code{"both"},
-  \code{"backward"}, or \code{"forward"}, with a default of \code{"both"}.  
-  If the \code{scope} argument is missing, the default for \code{direction}
-   is \code{"backward"}.	  
+  \code{"backward"}, or \code{"forward"}, with a default of
+  \code{"both"}.  If the \code{scope} argument is missing, the default
+  for \code{direction} is \code{"backward"} in \code{ordistep} (and
+  \code{ordiR2step} does not have this argument, but only works
+  forward).
 }
   \item{Pin, Pout}{
   Limits of permutation \eqn{P}-values for adding (\code{Pin}) a term to 
@@ -88,31 +89,27 @@ ordiR2step(object, scope, direction = c("both", "forward"),
   permutation \eqn{P}-values.
  
   Function \code{ordistep} defines the model, \code{scope} of models
-  considered, and \code{direction} of the procedure similarly as 
-  \code{\link{step}}. The function alternates with \code{drop} and 
+  considered, and \code{direction} of the procedure similarly as
+  \code{\link{step}}. The function alternates with \code{drop} and
   \code{add} steps and stops when the model was not changed during one
-  step. The \code{-} and \code{+} signs in the summary
-  table indicate which stage is performed. The number of permutations
-  is selected adaptively with respect to the defined decision limit. It
-  is often sensible to have \code{Pout} \eqn{>} \code{Pin} in stepwise
-  models to avoid cyclic adds and drops of single terms. 
+  step. The \code{-} and \code{+} signs in the summary table indicate
+  which stage is performed.  It is often sensible to have \code{Pout}
+  \eqn{>} \code{Pin} in stepwise models to avoid cyclic adds and drops
+  of single terms.
 
-  Function \code{ordiR2step} builds model so that it maximizes
+  Function \code{ordiR2step} builds model forward so that it maximizes
   adjusted \eqn{R^2}{R2} (function \code{\link{RsquareAdj}}) at every
   step, and stopping when the adjusted \eqn{R^2}{R2} starts to
   decrease, or the adjusted \eqn{R^2}{R2} of the \code{scope} is
   exceeded, or the selected permutation \eqn{P}-value is exceeded
   (Blanchet et al. 2008). The second criterion is ignored with option
-  \code{R2step = FALSE}, and the third criterion can be ignored
-  setting \code{Pin = 1} (or higher).  The \code{direction} has
-  choices \code{"forward"} and \code{"both"}, but it is very
-  exceptional that a term is dropped with the adjusted \eqn{R^2}{R2}
-  criterion. Adjusted \eqn{R^2}{R2} cannot be calculated if the number
-  of predictors is higher than the number of observations, but such
-  models can be analysed with \code{R2scope = FALSE}.  The
-  \eqn{R^2}{R2} of \code{\link{cca}} is based on simulations (see
-  \code{\link{RsquareAdj}}) and different runs of \code{ordiR2step}
-  can give different results.
+  \code{R2scope = FALSE}, and the third criterion can be ignored
+  setting \code{Pin = 1} (or higher). Adjusted \eqn{R^2}{R2} cannot be
+  calculated if the number of predictors is higher than the number of
+  observations, but such models can be analysed with
+  \code{R2scope = FALSE}.  The \eqn{R^2}{R2} of \code{\link{cca}} is
+  based on simulations (see \code{\link{RsquareAdj}}) and different
+  runs of \code{ordiR2step} can give different results.
 
   Functions \code{ordistep} (based on \eqn{P} values) and \code{ordiR2step}
   (based on adjusted \eqn{R^2}{R2} and hence on eigenvalues) can select
@@ -137,13 +134,16 @@ ordiR2step(object, scope, direction = c("both", "forward"),
 }
 
 \seealso{
-  The function handles constrained ordination methods \code{\link{cca}},
-  \code{\link{rda}} and \code{\link{capscale}}. The underlying functions 
-  are \code{\link{add1.cca}} and \code{\link{drop1.cca}}, and the 
-  function is modelled after standard \code{\link{step}} (which also can 
-  be used directly but uses AIC for model choice, see 
-  \code{\link{extractAIC.cca}}). Function \code{ordiR2step} builds upon
-  \code{\link{RsquareAdj}}.  
+
+  The function handles constrained ordination methods
+  \code{\link{cca}}, \code{\link{rda}}, \code{\link{dbrda}} and
+  \code{\link{capscale}}. The underlying functions are
+  \code{\link{add1.cca}} and \code{\link{drop1.cca}}, and the function
+  is modelled after standard \code{\link{step}} (which also can be
+  used directly but uses AIC for model choice, see
+  \code{\link{extractAIC.cca}}). Function \code{ordiR2step} builds
+  upon \code{\link{RsquareAdj}}.
+
 }
 \examples{
 ## See add1.cca for another example
diff --git a/man/ordisurf.Rd b/man/ordisurf.Rd
index 334e671..2f30922 100644
--- a/man/ordisurf.Rd
+++ b/man/ordisurf.Rd
@@ -14,7 +14,7 @@
 \method{ordisurf}{default}(x, y, choices = c(1, 2), knots = 10,
          family = "gaussian", col = "red", isotropic = TRUE,
          thinplate = TRUE, bs = "tp", fx = FALSE, add = FALSE,
-         display = "sites", w = weights(x), main, nlevels = 10,
+         display = "sites", w = weights(x, display), main, nlevels = 10,
          levels, npoints = 31, labcex = 0.6, bubble = FALSE,
          cex = 1, select = TRUE, method = "REML", gamma = 1,
          plot = TRUE, lwd.cl = par("lwd"), ...)
diff --git a/man/orditkplot.Rd b/man/orditkplot.Rd
index a8897a2..1a85d0d 100644
--- a/man/orditkplot.Rd
+++ b/man/orditkplot.Rd
@@ -82,7 +82,7 @@ orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim,
   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
+  legacy program XFig. Button \strong{Save 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
@@ -90,9 +90,9 @@ orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim,
   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, but
-  use the stored defaults for consistency with \code{plot.orditkplot} if
-  non are supplied by the user. Finally, button \strong{Dismiss} closes
-  the window.
+  use the stored defaults for consistency with \code{plot.orditkplot}
+  if none are supplied. Finally, button \strong{Close} 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
@@ -104,9 +104,11 @@ orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim,
   The function only displays one set of scores. However, you can use
   \code{\link{ordipointlabel}} to produce a result object that has
   different points and text types for several sets of scores and this
-  can further edited with \code{orditkplot}. For a good starting
-  solution you need to scale the \code{\link{ordipointlabel}} result so
-  that the points span over the whole horizontal axis.
+  can be further edited with \code{orditkplot}. For a good starting
+  solution you need to scale the \code{\link{ordipointlabel}} result
+  so that the points span over the whole horizontal axis. The function
+  cannot show environmental variables or constraints, but it is
+  limited to unconstrained ordination.
 
   The plot is a Tcl/Tk canvas, but the function tries to replicate
   standard graphical device of the platform, and it honours several
@@ -130,26 +132,29 @@ orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim,
   \code{plot.orditkplot}.  }
 
 \value{ Function returns nothing useful directly, but you can save the
-  edited graph to a file or dump the edited positions to an \R session
+  edited graph to a file or save the edited positions to an \R session
   for further processing and plotting.  
 }
 
 \author{ Jari Oksanen }
 \note{
   You need \pkg{tcltk} package and \R must have been configured with
-  \code{\link{capabilities}} for \code{tcltk} when building the binary.
+  \code{\link{capabilities}} for \code{tcltk}.
   Depending on your OS, you may need to start X11 and set the display
   before loading \pkg{tcltk} and starting the function (for instance,
   with \code{Sys.setenv("DISPLAY"=":0")}). See
   \code{\link[tcltk]{tcltk-package}}. 
 
 }
+
 \seealso{ Function \code{\link{ordipointlabel}} is an automatic
-  procedure with similar goals of avoiding overplotting. 	   
-  See \code{\link{ordiplot}}, \code{\link{plot.cca}},
-  \code{\link[vegan3d]{ordirgl}} and \code{\link{orditorp}} for alternative
-  ordination plots, and \code{\link{scores}} for extracting ordination
-  scores.  }
+  procedure with similar goals of avoiding overplotting, and its
+  output can be edited with \code{orditkplot}.  See
+  \code{\link{ordiplot}}, \code{\link{plot.cca}},
+  \code{\link[vegan3d]{ordirgl}} and \code{\link{orditorp}} for
+  alternative ordination plots, and \code{\link{scores}} for
+  extracting ordination scores.  }
+
 \examples{
 ## The example needs user interaction and is not executed directly.
 ## It should work when pasted to the window.
diff --git a/man/plot.cca.Rd b/man/plot.cca.Rd
index b8cbe7e..57e6d22 100644
--- a/man/plot.cca.Rd
+++ b/man/plot.cca.Rd
@@ -161,16 +161,6 @@
   the points or other functions in the \code{\link{ordiplot}} family. 
 }
 
-\note{Package \pkg{ade4} has function \code{\link[ade4]{cca}} which
-  returns constrained correspondence analysis of the same class as the
-  \pkg{vegan} function. If you have results of \pkg{ade4} in your
-  working environment, \pkg{vegan} functions may try to handle them and
-  fail with cryptic error messages. However, there is a simple utility
-  function \code{ade2vegancca} which tries to translate \pkg{ade4}
-  \code{cca} results to \pkg{vegan} \code{cca} results so that some
-  \pkg{vegan} functions may work partially with \pkg{ade4} objects
-  (with a warning).} 
-
 \author{Jari Oksanen }
 
 \seealso{\code{\link{cca}}, \code{\link{rda}} and \code{\link{capscale}}
diff --git a/man/specaccum.Rd b/man/specaccum.Rd
index 33b8cf8..19a36bb 100644
--- a/man/specaccum.Rd
+++ b/man/specaccum.Rd
@@ -159,7 +159,7 @@ specslope(object, at)
   self-starting species accumulation model. The input \code{object}
   can be a result of \code{specaccum} or a community in data frame. In
   the latter case the function first fits a \code{specaccum} model and
-  then proceeds with fitting the a nonlinear model. The function can
+  then proceeds with fitting the nonlinear model. The function can
   apply a limited set of nonlinear regression models suggested for
   species-area relationship (Dengler 2009). All these are
   \code{\link{selfStart}} models. The permissible alternatives are
diff --git a/man/vegan-internal.Rd b/man/vegan-internal.Rd
index c35ed6b..9dfcb1c 100644
--- a/man/vegan-internal.Rd
+++ b/man/vegan-internal.Rd
@@ -34,7 +34,7 @@ getPermuteMatrix(perm, N, strata = NULL)
 howHead(x, ...)
 pasteCall(call, prefix = "Call:")
 veganCovEllipse(cov, center = c(0, 0), scale = 1, npoints = 100)
-veganMahatrans(x, s2, tol = 1e-8)
+veganMahatrans(x, s2, tol = sqrt(.Machine$double.eps))
 hierParseFormula(formula, data)
 GowerDblcen(x, na.rm = TRUE)
 addLingoes(d)
diff --git a/man/vegdist.Rd b/man/vegdist.Rd
index 43b74db..5a3f9d4 100644
--- a/man/vegdist.Rd
+++ b/man/vegdist.Rd
@@ -78,7 +78,7 @@
     \cr
     \code{canberra}
     \tab \eqn{d_{jk}=\frac{1}{NZ} \sum_i
-      \frac{|x_{ij}-x_{ik}|}{x_{ij}+x_{ik}}}{d[jk] = (1/NZ) sum ((x[ij]-x[ik])/(x[ij]+x[ik]))}
+      \frac{|x_{ij}-x_{ik}|}{|x_{ij}|+|x_{ik}|}}{d[jk] = (1/NZ) sum (abs(x[ij]-x[ik])/(abs(x[ij])+abs(x[ik])))}
     \cr
     \tab where \eqn{NZ} is the number of non-zero entries.
     \cr \tab binary: \eqn{\frac{A+B-2J}{A+B-J}}{(A+B-2*J)/(A+B-J)}
@@ -217,7 +217,11 @@
   index is not commonly used for community data, but it is sometimes
   used for environmental variables. The calculation is based on
   transforming data matrix and then using Euclidean distances
-  following Mardia et al. (1979).
+  following Mardia et al. (1979). The Mahalanobis transformation
+  usually fails when the number of columns is larger than the number
+  of rows (sampling units). When the transformation fails, the
+  distances are nearly constant except for small numeric noise. Users
+  must check that the returned Mahalanobis distances are meaningful.
 
   Euclidean and Manhattan dissimilarities are not good in gradient
   separation without proper standardization but are still included for
diff --git a/src/init.c b/src/init.c
new file mode 100644
index 0000000..47e3099
--- /dev/null
+++ b/src/init.c
@@ -0,0 +1,79 @@
+#include <R_ext/RS.h>
+#include <stdlib.h> // for NULL
+#include <R_ext/Rdynload.h>
+
+/* FIXME: 
+   Check these declarations against the C/Fortran source code.
+*/
+
+/* .C calls */
+extern void abuswap(void *, void *, void *, void *, void *);
+extern void curveball(void *, void *, void *, void *, void *);
+extern void data2hill(void *, void *, void *, void *, void *, void *, void *, void *);
+extern void dykstrapath(void *, void *, void *, void *, void *);
+extern void goffactor(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
+extern void pnpoly(void *, void *, void *, void *, void *, void *, void *);
+extern void primtree(void *, void *, void *, void *, void *);
+extern void quasiswap(void *, void *, void *, void *);
+extern void rswapcount(void *, void *, void *, void *);
+extern void stepabyss(void *, void *, void *, void *);
+extern void stepacross(void *, void *, void *, void *);
+extern void swap(void *, void *, void *, void *);
+extern void swapcount(void *, void *, void *, void *);
+extern void trialswap(void *, void *, void *, void *);
+extern void veg_distance(void *, void *, void *, void *, void *, void *);
+extern void wcentre(void *, void *, void *, void *);
+
+/* .Fortran calls */
+extern void F77_NAME(cepclose)();
+extern void F77_NAME(cepcond)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
+extern void F77_NAME(cepfree)(void *, void *, void *, void *, void *, void *, void *, void *, void *);
+extern void F77_NAME(cephead)(void *, void *, void *, void *, void *);
+extern void F77_NAME(cepnames)(void *);
+extern void F77_NAME(cepopen)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
+extern void F77_NAME(cutup)(void *, void *, void *, void *);
+extern void F77_NAME(eigy)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
+extern void F77_NAME(monomds)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
+extern void F77_NAME(orderdata)(void *, void *, void *, void *);
+extern void F77_NAME(yxmult)(void *, void *, void *, void *, void *, void *, void *, void *, void *);
+
+static const R_CMethodDef CEntries[] = {
+    {"abuswap",      (DL_FUNC) &abuswap,       5},
+    {"curveball",    (DL_FUNC) &curveball,     5},
+    {"data2hill",    (DL_FUNC) &data2hill,     8},
+    {"dykstrapath",  (DL_FUNC) &dykstrapath,   5},
+    {"goffactor",    (DL_FUNC) &goffactor,    10},
+    {"pnpoly",       (DL_FUNC) &pnpoly,        7},
+    {"primtree",     (DL_FUNC) &primtree,      5},
+    {"quasiswap",    (DL_FUNC) &quasiswap,     4},
+    {"rswapcount",   (DL_FUNC) &rswapcount,    4},
+    {"stepabyss",    (DL_FUNC) &stepabyss,     4},
+    {"stepacross",   (DL_FUNC) &stepacross,    4},
+    {"swap",         (DL_FUNC) &swap,          4},
+    {"swapcount",    (DL_FUNC) &swapcount,     4},
+    {"trialswap",    (DL_FUNC) &trialswap,     4},
+    {"veg_distance", (DL_FUNC) &veg_distance,  6},
+    {"wcentre",      (DL_FUNC) &wcentre,       4},
+    {NULL, NULL, 0}
+};
+
+static const R_FortranMethodDef FortranEntries[] = {
+    {"cepclose",  (DL_FUNC) &F77_NAME(cepclose),   0},
+    {"cepcond",   (DL_FUNC) &F77_NAME(cepcond),   11},
+    {"cepfree",   (DL_FUNC) &F77_NAME(cepfree),    9},
+    {"cephead",   (DL_FUNC) &F77_NAME(cephead),    5},
+    {"cepnames",  (DL_FUNC) &F77_NAME(cepnames),   1},
+    {"cepopen",   (DL_FUNC) &F77_NAME(cepopen),   10},
+    {"cutup",     (DL_FUNC) &F77_NAME(cutup),      4},
+    {"eigy",      (DL_FUNC) &F77_NAME(eigy),      27},
+    {"monomds",   (DL_FUNC) &F77_NAME(monomds),   25},
+    {"orderdata", (DL_FUNC) &F77_NAME(orderdata),  4},
+    {"yxmult",    (DL_FUNC) &F77_NAME(yxmult),     9},
+    {NULL, NULL, 0}
+};
+
+void R_init_vegan(DllInfo *dll)
+{
+    R_registerRoutines(dll, CEntries, NULL, FortranEntries, NULL);
+    R_useDynamicSymbols(dll, FALSE);
+}
diff --git a/src/vegdist.c b/src/vegdist.c
index f97447b..e05e1ac 100644
--- a/src/vegdist.c
+++ b/src/vegdist.c
@@ -165,7 +165,7 @@ double veg_canberra(double *x, int nr, int nc, int i1, int i2)
 	  if (!ISNAN(x[i1]) && !ISNAN(x[i2])) {
 	       if (x[i1] != 0 || x[i2] != 0) {
 		    count++;
-		    denom = x[i1] + x[i2];
+		    denom = fabs(x[i1]) + fabs(x[i2]);
 		    if (denom > 0.0) {
 			 numer = fabs(x[i1] - x[i2]);
 			 dist += numer/denom;
diff --git a/vignettes/FAQ-vegan.Rmd b/vignettes/FAQ-vegan.Rmd
index 3c58581..a29d3fb 100644
--- a/vignettes/FAQ-vegan.Rmd
+++ b/vignettes/FAQ-vegan.Rmd
@@ -97,11 +97,11 @@ automatically install sets of most important packages.
 ### What other documentation is available for **vegan**?
 
 **Vegan** is a fully documented R package with standard help pages.
-These are the most authoritative sources of documentation (and as a last
-resource you can use the force and the read the source, as **vegan** is
-open source). **Vegan** package ships with other documents which can be
-read with `vegandocs` command (documented in the **vegan** help). The
-documents included in the **vegan** package are
+These are the most authoritative sources of documentation (and as a
+last resource you can use the force and the read the source, as
+**vegan** is open source). **Vegan** package ships with other
+documents which can be read with `browseVignettes("vegan")`
+command. The documents included in the **vegan** package are
 
 -   **Vegan** `NEWS`
 -   This document (`FAQ-vegan`).
@@ -347,18 +347,15 @@ The scaling or RDA results indeed differ from most other software
 packages. The scaling of RDA is such a complicated issue that it cannot
 be explained in this FAQ, but it is explained in a separate pdf document
 on “Design decision and implementation details in vegan” that you can
-read with **vegan** command `vegandocs("decision")`.
+read with command `browseVignettes("vegan")`.
 
 ------------------------------------------------------------------------
 
 ### cca fails with “data.frame expected” or “"site.env" missing”
 
-This is not a **vegan** error message, but it comes from the `cca`
-function in the **ade4** package. There is an unfortunate name clash,
-and if you have loaded **ade4** after **vegan**, the **ade4** version of
-`cca` will mask the **vegan** version. You can use the **vegan** version
-using command `vegan::cca()`. If you do not need package **ade4**, you
-can detach it with command `detach(package:ade4)`.
+This is not a **vegan** error message, but it comes from an old
+version of the **ade4** package (prior to **ade4** 1.7-8, released Aug
+9, 2017). Upgrade your **ade4**.
 
 ------------------------------------------------------------------------
 

-- 
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