Changelog
Source:NEWS.md
vegan 2.8-0
New Functions
influence.cca: a new wrapper function to returnhatvalues,rstandard,rstudentandcooks.distance. The result can be amended with working fitted values, and returned intidyformat that can be used as input in ggplot2 (or lattice) graphics to substitute defunctordiresidsfunction.Internal
ordConstrainedis exported. Function is the central numerical engine of constrained ordination methods (cca,rda,dbrda,capscale) and provides a hacker interface that can be embedded in other functions and used to develop alternative methods. The Examples show how to implement weighted RDA.
New Features
metaMDScan use any MDS function as anengineif the function takes as input dissimilarities, initial configuration and number of axes, and returns a list with elements stress and points for final solution.vegan::monoMDSandMASS::isoMDSare such functions, but other MDS functions can be easily wrapped to make them compatible. The Examples in the help page shows how to wrapsmacof::mds. The default engine is stillvegan::monoMDS, and the user experience with this default choice is unchanged.adonis2can haveConditionin formula allowing similar analysis of partial models as indbrda.plot.envfitcan use criterionr2.minfor lower threshold of of displayed variables. Bothp.maxandr2.minmust be satisfied for displayed items.ordipointlabelis faster. This was achieved using tighter bounding box which reduced the number of potentially overlapping labels. The used bounding box is shown with argumentbg = <colour>. The function is also invoked fromplotandtextfunctions for ordination results with argumentoptimize = TRUE.varpartlabels the sources of variation by the full definition of the term in plots, but switches toX1etc if the full name does not fit the graph. Tilde is stripped from the term name.adipartcan use Hill numbers 1 and 2 in additive diversity partitioning per wish of #752. Earlier it was possible to use these only viahiersimu.
Bug Fixes
-
decostand(..., method = "rclr")andoptspacelost row and column names of imputed matrix. Issue #759.Back-transformation of
"rclr"failed withdecobackstand. Back-transformation cannot be done with imputed matrix, and without imputed matrix original zeros were returned asNA. vegdist(..., binary = TRUE)did not use binary data in Chi-square and Mahalanobis distances (methods"chisq"and"mahalanobis").
Defunct
Lattice functions
ordicloud,ordiresidsandordisplomare defunct.ordicloudis available in CRAN package vegan3d asordilattice3d. New functioninfluence.ccacan prepare data to be used in similar graphics asordiresidsusing ggplot2 or lattice.Argument
thinplateis finally defunct inordisurf: useisotropic. The argument was deprecated in 2013 (CRAN release 2.0-8).
vegan 2.7-2
CRAN release: 2025-10-08
New Features
vegan is now more robust with community data frames with ‘automatic’ row names. ‘Automatic’ row names do not actually exist but data frames only have information on the number of row names needed, and names are generated automatically when they are queried. This is very commonly used in
tibble. However, the row names are not generated by default when the data frame is changed to matrix for numerical analysis. Many methods in vegan assume that there are row names, in particular in ordination methods, and many functions failed with ‘automatic’ row names (tibble) and vegan could not be built or checked with them. Now the row names are forced in conversion to matrix and this should remove possible problems in usingtibble.anovaandpermutestfor partial RDA, dbRDA etc. residualize constraints similarly as partial CCA has done since vegan release 2.6-6. This has an effect in partial models withConditionterm.add1for constrained ordination no longer bases permutation tests on partial model, but uses a method that is consistent with marginal tests indrop1. Inordistepthe P-value of the last added term is unchanged when it is considered for dropping using the same permutations.anova.cca(..., by = "axis")is no longer based on partial ordination but is consistent with otherbycases. This has an effect on later non-significant axes, but in non-partial models does not influence the P-value of the first axis.biplot.rdadraws arrows of the same length both with"points"and"text". Earlier shorter arrows were drawn with"text". Now the arrow head is at the actual species scores and points to the text label similarly as in plot functions for rda and envfit.ordilabelcan use variable character expansion (cex) and with thisplot.cca,ordiplotetc. gained the same ability.
Bug Fixes
anovaandpermutestwith argumentsby = "terms"orby = "onedf"was wrong in partial CCA. There were no problems in normal CCA without theConditionterm, other [partial] constrained ordination methods, or with otherbyarguments. The bug was introduced in vegan release 2.6-6.summaryformantel,mrpp,oecosimu, andordiareatestdid not pass dot arguments (...) to the underlyingsummary.permustats. These arguments allow changing sidedness or the critical P-value of the summary.decostandstandardization"rrank"failed withna.rm = FALSE. Bug report #753.ordilabelandordipointlabelfroze the graphical device if the function stopped with an error.
vegan 2.7-1
CRAN release: 2025-06-05
Installation
vegan no longer depends on lattice, but only imports lattice functions. The lattice package is no longer automatically loaded. To use lattice functions directly, you must first attach the package with
library(lattice). Longer-term plan is to remove lattice functions as soon as more modern alternatives in ggplot2 are made available. See Discussion #727 and section Deprecated and Defunct for the changes in this release.vegan no longer suggests tcltk. See
orditkplotin section Deprecated and Defunct.
New Functions
Added a set of functions to add new points to an existing NMDS ordination from
metaMDSormonoMDS. This serves the same purpose as adding new points to an existing eigenvector ordination (for instance,predict.rda). The main function isMDSaddpoints. This needs an input of rectangular matrix of dissimilarities of all new points (rows) to all old points (columns). Support functiondist2xycan extract needed matrices from dissimilarities of all (old and new) points, and functiondesigndist2can directly find the needed dissimilarities between two data matrices. In addition, analogue package can calculate such rectangular dissimilarities, including many indices that cannot be defined withdesigndist2.betadistances: new functions to find distances of points to group centroids inbetadisper. See https://stackoverflow.com/questions/77391007/ and issue #606.permulattice: new function to use lattice graphics forpermustatsresults without need to first issuelibrary(lattice).optspace: a new function for matrix completion or filling missing elements in a matrix. The function is used in robust Aitchison distance (see below).
New Features in Ordination Graphics
-
plot.ccagraphics can be configured.plot.ccahad hard-coded graphical parameters and user arguments were ignored (see issue #656). Now graphical parameters can be given either for all score types, or with a list of graphical parameters for a specific score.The new features are more extensively described in help pages of
plot.cca,ordiplotandbiplot.rda. text.ordiplotand henceplot.ccagained argumentoptimizethat will callordipointlabelto optimize the location of the text to minimize over-writing, but mark the exact score with a point.text.ordiplotand henceplot.ccagained argumentbg=<colour>that will plot text over non-transparent label usingordilabel.Alternatively ordination plots can be built up adding each score type in piped commands. Pipes were available since vegan 2.5-1, but their use is now improved:
ordilabelcan be used in a pipe,textcan use opaque background label, andtextandpointsfunction (forordiplot) gained argument for adjusting arrow lengths similarly as incca.text.ccaandpoints.ccawere completely redesigned because of the concerns raised in PR #729. Support functionlabels.ccanow accepts abbreviated names of score types.textfunctions for ordination graphics have argumentslabelsto renametextandselectto show only some items. Now these functions are consistent and use firstselectand thenlabelsfor the selected subset. Concerns functionsordilabel,ordipointlabel,orditorpas well astextfunctions forccaand friends,decorana,monoMDS,metaMDSandordiplot. See issue #730.orditorp,points.ccaandtext.ccadid not accept row names orlabelsinselect. PR #729.Species scores can be added to
monoMDSwithsppscoresfunction, and now these can be accessed inpointsandtextfunctions.ordipointlabelcan be used in pipe. Function gained argumentlabelthat allows changing plotted text, and a functionlabelsthat return the current labels. The optimization rules were changed to give a slight preference for putting labels outwards from origin but avoiding corner positions.orditorpcan be used in pipe.
New Features in Other Functions
Constrained ordination models (
cca,rda,dbrda) inform users on completely aliased conditions or constraints, and behave more robustly with these degenerate cases. If a model component (condition, constrained, residual unconstrained) is completely aliased, it still appears in summary table with rank and inertia 0. See https://stackoverflow.com/questions/79613784/ and issue #682.Robust Aitchison distance uses matrix completion to estimate the missing values (
-Inf) that result from log transformation of zeros of the original input data. Earlier we used only above zero values, or in simple Aitchison distance replaced zeros with an arbitrary pseudocount. For matrix completion vegan adds new functionoptspacewhich also can be used independently. The Robust Aitchison distance is directly evaluated invegdist, and the needed transformation can be performed indecostand. PR #667.ordiR2stepcalls current model<model>instead of<none>.vegemiteandtabascocan nowusea factor to show a classification. The factor levels and sites within levels can be reordered to give a diagonal pattern, as default intabascoand invegemitewith new argumentdiagonalize = TRUE(defaultsFALSE). With the same argument,vegemitecan also reorder dendrogram (or tree) to give a diagonal pattern. Ifcoverscaleis used, all internal calculations for ordering rows and columns will be based on scaled data.make.cepnameswas completely re-designed and is much more flexible with enhanced user-control.wascorescan now calculate (unbiased) weighted standard deviation of weighted averages with argumentstdev = TRUE.mantel,mrpp,oecosimuandordiareatestgainedsummarymethods based onsummary.permustats.
Bug Fixes
ordistepnever dropped aliased terms.permatswapfailed to set some null models (swsh_samp,swsh_both,backtrack).df.residual.ccaignored conditions (partial component). This influences many diagnostic statistics documented together withcooks.distance.ccaandrstandard.cca.densityplot.permustatsdid not know argumentobservedto display the observed statistic.
Deprecated and Defunct
adonisis defunct in favour ofadonis2. See announcement #641 for fixing your code.Disabled use of
summaryto get ordination scores: usescoresto get scores! Forsummary.ccasee #644.lattice function
ordicloudis deprecated. It is still available in CRAN package vegan3d (version 1.4-0) as functionordilattice3d.lattice function
ordisplomis deprecated: it had bad design and was not very useful.lattice function
ordiresidsis deprecated: you can access the same items usingfitted,residuals,rstandard,rstudentetc and design your own plots.summary.decoranais defunct. It did nothing useful, but you can extract the same information withscoresandweights.orditkplotwas moved to vegan3d package and is defunct in vegan.relic function
vegandocsis officially defunct. Better tools to read vegan documentation arebrowseVignettes("vegan")andnews(package="vegan"). The function was deprecated in vegan 2.3-4.
vegan 2.6-10
CRAN release: 2025-01-29
Startup
- Prints startup message (“This is vegan 2.6-10”) only in interactive sessions. Version number is no longer shown in package checks and other scripts.
Bug Fixes
anova.cca(..., by="margin")failed when a constraint was completely aliased by conditions. See #701.-
envfitfailed when ordination scores were given in a plain matrix instead of a complex ordination result object. Issue #713.envfitcould fail when it was called with only one environmental variable without formula interface. Formula interface worked correctly. Issue #720. -
vegemitedropped dimensions when only one site or species was requested.vegemitecould fail with variable lengths of row names (SU names).
vegan 2.6-8
CRAN release: 2024-08-28
New Features
Wrappers for the unconstrained ordination methods principal components analysis (PCA), correspondence anslysis (CA), and principal coordinates analysis (PCO) are now available via
pca(),ca(), andpco()respectively. The underlying methods used arerda(),cca()anddbrda()respectively. See #655.The output from the ordination methods
pca(),pco(),ca(),rda(),cca(),capscale, anddbrda()has changed slightly to better separate the results from notifications to the user about issues encountered with the data or the model. Related to changes in #682.The constrained ordination functions are now louder at informing users when one or more terms in a model are aliased (linearly dependent) and their effects cannot be estimated. See #682.
ccaandrdareturn centroids for factor levels even when they are called without formula, for instance, ascca(dune, dune.env).plot.ccaretains default graphical settings also when only one set of scores was displayed.ordiplotdid not pass character size (cex) toplot.cca. Version 2.7-0 has more extensive changes, but this fixes the immediate issue #656.adonis2()now defaults to running an omnibus test of the model (by = NULL) instead of a sequential test of model terms (by = "terms"). This makesadonis2()more consistent with the default for related ordination methods. See #677.decoranachecks now that input data are numeric instead of confusing error message (see https://stackoverflow.com/questions/78666646/).make.cepnamesno longer splits names by hyphen: Capsella bursa-pastoris used to beCapspastbut now isCapsburs.
Bug Fixes
dbrdafailed in rare cases when an ordination component had only negative eigenvalues. Issue #670.plot.cca: biplot or regression arrows were not nicely scaled and drew no arrows when displayed as the only item in graph.ordipointlabelfailed withdecoranaresult. Bounding box for text could be wrongly estimated with varying values ofcex.vegdistwith argumentna.rm = TRUEstill failed with missing values. Dissimilarity methods"chisq"(Chi-square distance) and"mahalanobis"did not implementna.rm = TRUE. Even when missing values are removed in calculation, dissimilarities may containNAdepending on the number and pattern of missing values and dissimilarity method.decostandstandardization method"clr"did not implementna.rm = TRUE(issue #661). Standardization methods"rank"and"rrank"did not retainNAvalues but changed them to 0. OriginalNAvalues are kept indecostand, but withna.rm = TRUEthey are ignored when transforming other data values.metaMDS: half-change scaling failed whenmaxdistwas fixed, but was not 1.summary.ordihull(and henceordiareatestfor convex hulls) failed if input had more than two dimensions.simulate.rdafailed with univariate response.vegemitereturned only the last page of multi-page table in its (invisible) return object.
vegan 2.6-6.1
CRAN release: 2024-05-21
Bug Fixes
- C function
do_wcentre(weighted centring) can segfault due to a protection error. The problem was found in automatic CRAN checks.do_wcentreis an internal function that is called fromenvfit(vectorfit),wcmdscaleandvarpart(simpleCCA) Fixes bug #653.
vegan 2.6-6
CRAN release: 2024-05-14
Installation
vegan depends on R version 4.1.0.
It is possible to build vegan with webR/wasm Fortran compiler. Issue #623.
New Features
Permutation tests for CCA were completely redesigned to follow C.J.F ter Braak & D.E. te Beest: Environ Ecol Stat 29, 849–868 (2022) (https://doi.org/10.1007/s10651-022-00545-4). The constraints are now re-weighted for the permuted response data, and in partial model they are also residualized by conditions (partial terms). In vegan (after release 2.4-6) the tests were identical to Canoco, but ter Braak & te Beest demonstrated that the results are biased. In old vegan (release 2.4-2 and earlier) the predictors were re-weighted but not residualized. Re-weighting was sufficient to remove bias with moderate variation of weights, but residualizing of predictors is necessary with strongly varying weights. See discussion in issue #542. The new scheme only concerns CCA which is a weighted method, and RDA and dbRDA permutation is unchanged.
summaryof ordination results no longer prints ordination scores that often are so voluminous that they hide the real summary; see issue #203. Ordination scores should be extracted withscoresfunction. This breaks some CRAN packages that usesummary.ccato extract scores. These should switch to usescores. The maintainers have been contacted and patch files are suggested to adapt to this change. See instructions to fix the packages.scoresfunction for constrained ordination (CCA, RDA,dbRDA) default to return all types of scores (display = "all"). Function can optionally return a single type of scores as a list of one matrix instead of returning a matrix (new argumentdroplist).Constrained ordination objects (
cca,rda,dbrda) fitted without formula interface can have permutation tests (anova) by"axis"and by"onedf". Models by"terms"and"margin"are only possible with formula interface.Permutation tests for constrained ordination objects (
cca,rda,dbrda) withby = "axis"stop permutations of later axis once thecutofflimit is reached. Earliercutoffhad to be exceeded. The default is to stop permutations once P-value 1 is reached. The analysis takes care that P-values of axes are non-decreasing similarly as in Canoco.Coefficients of effects in
prcmodels are scaled similarly as they were scaled in vegan pre 2.5-1. The change was suggested by Cajo ter Braak.Handling of negative eigenvalues was changed in the
summaryofeigenvals. Negative eigenvalues are given as negative “explanation”, and the accumulated proportions add up over 1 for the last non-negative eigenvalue, and 1 for the last negative eigenvalue.The printed output of
capscaleshows proportions for real components only and ignores imaginary dimensions. This is consistent tosummaryand other support methods. Issue #636.RsquareAdjofcapscaleis based only on positive eigenvalues, and imaginary components are ignored.stressplot.dbrdarefuses to handle partial models. Only the first component of variation can be displayed becausedbrdainternal (“working”) data structures are not additive. For unconstrained model"CA", for constrained"CCA"and for partial none.predictfordbrdawill return the actualtype = "working". Earlier it returned"lc"scores weighted by eigenvalues. Both generated same distances and eigenvalues, though.
Bug Fixes
Parallel processing was inefficiently implemented and could be slower than non-parallel in permutation tests for constrained ordination and
adonis2.plotandscoresforccaandrdafamily of methods gave an error when non-existing axes were requested. Now ignores requests to axes numbers that are higher than in the result object.summaryofprcignored extra parameters (such asconst).Over-fitted models with high number of aliased variables caused a rare failure in
adonis2and permutation tests of constrained ordination methods (cca,rda,dbrda,capscale) with argumentsby = "margin"orby = "axis". This also concernedvif.ccaandintersetcor. Typically this occurred with high-order interactions of factor variables. See issues #452 and #622Some methods accept rectangular raw data input as alternative to distances, but did not pass all arguments to distance functions. These arguments in
vegdistcould bebinary = TRUEorpseudocountwith Aitchison distance. This concernsdbrda,capscaleandbioenv. See issue #631simpergave arbitrary p-values for species that did not occur in a subset. Now these are given asNA. See https://stackoverflow.com/questions/77881877/Rsquare.adjgave arbitrary p-values for over-fitted models with no residual variation. Now returnsNAwhen R2 cannot be adjusted. Automatic model building could proceed to such cases, and this was fixed inordiR2stepwhich returns R2 = 0 for overfitted cases. The constrained ordination methods issue a warning if the model has no residual component. See issue #610inertcomp(..., display = "sites", proportional = TRUE)gave wrong values.
Data Sets
- Extended the description of the BCI data sets to avoid confusion. The complete BCI survey includes all stems of down to 1 cm DBH, but the BCI data set in vegan is a subset of stems of DBH 10 cm that was published in Science 295, 666—669, 2002. The data set is intended only to demonstrate methods in vegan and for ecological research we suggest contacting the BCI team and using the complete surveys made available in Dryad.
Deprecated and Defunct
adonisis deprecated: useadonis2. There are several CRAN packages that still useadonisalthough we have contacted all their authors in June 2022 and again in April 2024, and printed a message of forthcoming deprecation since vegan 2.6-2. See issue #523. See instructions to adapt your packages and functions to useadonis2.orditkplotwas moved to CRAN package vegan3d and is deprecated in vegan. See issue #585 and announcement #632The use of
summaryto extract ordination scores is deprecated: you should usescoresto extract scores. This version still allows extracting scores withsummary, but this will fail in next versions. Forsummary.ccasee instructions to change your package.Support was removed from ancient
ccaobjects (results ofcca,rda,dbrdaorcapscale) generated before CRAN release 2.5 (2016). If you still have such stray relics, usenewobject <- update(ancientobject)to modernize the result.as.mcmc.oecosimuandas.mcmc.permatare defunct: usetoCoda.Code of defunct functions was completely removed.
vegan 2.6-4
CRAN release: 2022-10-11
New Features
Support of
scoresfor ggplot2 graphics is improved and extended for ordination functions. Suitable scores can be requested with argumenttidy = TRUE, and in general all available types of scores are returned in a data frame with variablescorelabelling the type. The option was implemented in default method ofscoresand for structuredwcmdscaleobjects, and glitches were fixed forrdafamily anddecorana. Previouslytidyscores were implemented forcca,rda,dbrdafamily of methods,metaMDS,envfitandrarecurve.adonis2andanovafor constrained ordination results can perform a sequential test of one-degree-of-freedom effects where multi-level factors are split to their contrasts. Previously the test was available only inpermutest.New
summaryfunction forvarpartfor a brief overview. The summary shows unique and overall contributed variation for each set of variables. The fractions shared by several sets of variables are divided equally with all contributing sets following Lai J, Zou Y, Zhang J, Peres-Neto P (2022) Methods in Ecology and Evolution, 13: 782–788.decoranaestimates orthogonalized eigenvalues and the total inertia (scaled Chi-square). Orthogonalized eigenvalues can add up to the total inertia. Together these enabled implementingeigenvals,bstickandscreeplotmethods fordecorana.Axis lengths are reported for all
decoranamethods.Implemented
tolerancemethod fordecorana. This returns the criterion that was used in rescaling DCA, and can be used to inspect the success of rescaling: it should be constant 1 over the whole axis.New
toCodafunction to transform sequential null model results fromoecosimuto an object that can be analysed with coda for convergence and independence as an MCMC model. Function replacesas.mcmc.oecosimuandas.mcmc.permat.metaMDSis more informative about finding similar repeated results with random starts and uses less confusing language when reporting the results.Hellinger distance is directly available in
vegdist.vegdist,betadiverandraupcrickset attributemaxdistgiving the numeric value of theoretical maximum of the dissimilarity index. For many dissimilarities this is 1, but √2 for Chord and Hellinger distances, for instance. The attribute isNAfor open indices that do not have such a ceiling.betadiverhas three similarity indices and these setmaxdist0.metaMDSdefaults to halfchange scaling when the dissimilarities have a numericmaxdistattribute, and adapt the threshold to the ceiling value. For open indices without ceiling, the threshold will be in the scale of dissimilarities.metaMDSused a simple test to detect index ceiling 1, but the test is now more robust and can also find other maximum values. If such inference is made, the function will broadcast a message of assumed value of the ceiling.Mountford index in
vegdistis now scaled to maximum value log(2). Earlier Mountford distances were scaled to maximum 1.hatvaluesof constrained ordination objects can sometimes be practically 1 or above 1, but now these cases will be exactly 1. In those casesrstandard,rstudentandcooks.distancewill beNaN. The behaviour is similar as instats::lm.influencefunctions.as.radcan handle multi-row data frames or matrices and return a list of Rank-Abundance data for each row. Earlier only one site was handled.decostandreturns attributeparametersof settings and variables used in standardization. New functiondecobackstandcan useparametersto reconstruct original non-standardized data. Back-transformation is not exact but has round-off errors, although there is an attempt to keep original zeros exact. Back-transformation is not possible for methodspa,rankandrrankand it is not implemented foralr. Back-transformation queried in https://stackoverflow.com/questions/73263526/Rarefaction and rarefaction-based methods make sense only with original observed counts and give misleading results if data are multiplied or rare species are removed. Observed counts usually have singletons (species with count one), and these method issue a warning if minimum count is higher than one (which may be a false positive, but inspect your data). Concerns functions
rarefy,drarefy,rrarefy,rarecurve,specaccum(..., method="rarefy"),rareslopeandavgdist. See github discussion #537.avgdistexposesas.distarguments and can return"dist"ance objects that appear as lower triangles instead of appearing as symmetric matrices.
Bug Fixes
decoranareturned wrong results when Hill’s piecewise transformation (argumentsbefore/after) were used, unless downweighting was also used.scoresfailed whenmetaMDSresult had no species scores. Bug was introduced in release 2.6-2. Issue raised in https://stackoverflow.com/questions/72483924/tolerance.ccafailed when only one axis (choice) was requested.decostand(..., method="alr")did not accept name as areference, and could fail in some cases.CRAN package proxy interfered with
simperand caused an obscure error (github issue #528).
vegan 2.6-2
CRAN release: 2022-04-17
New Features
Aitchison and robust Aitchison distances were added to
vegdist. Similar data transformations were added todecostand.Several functions can return “tidy” data structures that can be used in ggplot2 graphics:
rarecurve,scoresfunctions for constrained ordination (ccaetc.),decorana,envfit,metaMDS.scores.envfitgained argumentarrow.mul. veganplotfunctions used this automatically, but now it is easier to useenvfitin non-vegan plotting.Added function
simpson.unbfor unbiased Simpson diversity that is more robust to the variation in sample sizes.diversitygained argumentgroupto calculate indices for pooled data. Discussed in issue #393.simperis much faster even though parallel processing is not implemented in the new code.pairsfunction was added to plotpermustatsvariables against each other.varpartaccepts dissimilarities given as a symmetric square matrix instead of"dist"object per wish of issue #497.metaMDSadopted a more user-friendly policy, andtrymaxwill always be the maximum number of tries. See dicussion in https://stackoverflow.com/questions/66748605/.adonis2acceptsstrata.adonis2is the new main function that replaces oldadonis. See issue #427.Fisher alpha (
fisherfit) is badly suited for extreme communities that do not follow Fisher’s model. NowfisherfitreturnsNAto communities that have 0 or 1 species, and issues a warning with communities consisting of singletons and having extreme Fisher alpha.adipartandmultipartformulae will automatically add unique id and and constant. This will always sandwich the requested grouping between alpha and gamma diversities, but not change the results for requested groupings.
Bug Fixes
anovafunction failed in marginal tests when constrained partial ordination model (cca,rdaetc.) had interaction terms. Issue #463.Constrained ordination (
ccaetc.) gave misleading results when all external variables (constraints, condition) were constant and explained nothing.decoranacould fail when some axes had zero eigenvalues. Issue #401.Species accumulation (
specaccum) failed when there was only one species, but several “communities”. Issue #501.Parallel processing failed in Windows or with socket clusters in
permutestofbetadisper. Issue #369.orditorpfailed if numeric labels were supplied. Reported in https://stackoverflow.com/questions/69272366/.Argument
summarizewas accidentally dropped fromgoodness.ccain 2017.taxa2distfailed if there was only one usable taxonomic level. See https://stackoverflow.com/questions/67231431/.
Deprecated and Defunct
Function
adonis2will replaceadonis.humpfitfunctions are defunct and removed. They are available in non-CRAN package natto at https://github.com/jarioksa/natto.commisimulatoris defunct. Usesimulatefornullmodelobjects.permuted.indexis finally defunct (it was deprecated in vegan 2.2-0).as.mlmis defunct. Use functions documented withinfluence.cca, such ashatvalues.cca,rstandard.cca,rstudent.cca,cooks.distance.ccaand others.
vegan 2.5-7
CRAN release: 2020-11-28
Bug Fixes
Several distance-based functions failed if all distances were zero (
betadisper,capscale,isomap,monoMDS,pcnm,wcmdscale). Reported in github issue #372.Non-linear self-starting regression models
SSarrhenius,SSgitay,SSgleasonandSSlomolinofailed in future R. The failure was caused by internal changes in R-devel. Github issue #382.Arrow labels were in wrong position in
plot.envfit(..., add = FALSE).rarecurveadded unnecessary names to the results. Github issue #352.permutestforbetadisperfailed in parallel processing in Windows and in other systems when socket clusters were used. Github issue #369.
New Features
Chi-square and Chord distances were added to
vegdist. Both of these distances can be calculated as Euclidean distances of transformed data, and actually were available earlier, but many users did not notice this.monoMDS(and hencemetaMDS) uses stricter convergence criteria. This improves possibilities to find stable solutions. However, users may still need to tweak convergence criteria with their data. See discussion in Github issue #354.textfunctions for constrained ordination plots (cca,rda,dbrda,capscale) accept now expression labels. This allows using subscripts, superscripts and mathematical expressions. New support functionlabels.ccareturns the current text labels so that authors can change the desired ones. See github issue #374.vegemitereturns invisibly the final formatted table allowing further processing.ordiplotpassescexargument tolinestackanddecoranaplots.
vegan 2.5-6
CRAN release: 2019-09-01
Bug Fixes
vegdistsilently accepted missing values (NA) and removed them from the analysis also with optionna.rm = FALSE. The behaviour was introduced in vegan version 2.5-1. See GitHub issue #319.The labels were displaced when the bunch of arrows was not drawn at the origin of the ordination graph in
envfit. See GitHub issue #315.Hill scale in
coverscaleis open-ended and is not limited to percent data, unlike most traditional cover class scales which are undefined above 100% cover.
vegan 2.5-5
CRAN release: 2019-05-12
Installation
vegan depends on R 3.4.0 or higher. The next vegan release may increase the dependence to R 3.6.0.
-
R 3.6.0 improved the method to find random indices for permuting and sampling data. Vegan relies now on the R functions in its ecological null models (functions
nullmodel,oecosimu,commsim,permatfull,permatswapand others). Technically this change is compatible with R 3.4.0 and later, but you can only gain the benefits of improved code with a current release of R. The null models may change due to this change, and most certainly they change in R 3.6.0. See NEWS for the R 3.6.0 release and discussion in github issue #312.Most vegan permutation routines rely on permute, and there you gain similar benefits of improved randomness when you upgrade R.
Thanks to the new R dependence,
sigmafor constrained ordination results works without workarounds of vegan 2.5-2. This fixes completely the issue discussed in #274.Vegan test results cannot be reproduced in older versions than R 3.6.0. If you are worried about this, you should upgrade R.
Bug Fixes
-
metaMDSfailed in scaling results when otherenginethanmonoMDSwas used. However, we recommend you usemonoMDS. See github issue #310.
New Features
-
betadisperchanged interpretation of negative squared distances which give complex-valued distances. Now they are regarded as zero-distances whereas earlier we used their modulus. This will change the results in cases where you had negative squared distances. For further discussion, see github issue #306.
vegan 2.5-4
CRAN release: 2019-02-04
Installation and Testing
The code for interpreting formula will change in R 3.6.0, and this makes constrained ordination methods (
cca,rda,dbrda,capscale) to fail. See github issue #299.R 3.6.0 introduces a new environment variable
_R_CHECK_LENGTH_1_LOGIC2_, and several functions fail if this variable is set. Changes concernordiplot,plotandsummaryfor constrained ordination objects, andordixyplot. See github issue #305.
Bug Fixes
decoranagave incorrect results when downweighting was used (argumentiweigh = 1). The bug was introduced in vegan 2.5-1 and reported as github issue #303.goodnessfor constrained ordination methods failed when the constraints had rank = 1 (only one constraining variable). Reported by Pierre Legendre.
New Features
- Adjusted R2 is enabled for partial RDA models (functions
rdaanddbrda) and partial CCA models (functioncca) in functionRsquareAdj. The feature was disabled in vegan 2.5-1 for both. For RDA, the calculation is similar as in vegan 2.4-6 and earlier. Partial CCA is now consistent with RDA and differs from the earlier implementation. For both methods, the partial models are consistent withvarpart. See github issue #295.
vegan 2.5-3
CRAN release: 2018-10-25
Installation
- Tests for numerical analysis were written more robustly so that they give more similar results with alternative platforms and versions of R and BLAS/Lapack libraries. See github issue #282.
Bug Fixes
Constrained ordination gave misleading results when some constraints or conditions had data with NULL variables. This rarely happens in normal usage, but could happen in marginal
anovaas reported in github issue #291.Several functions for numerical analysis wrongly accepted non-numeric data (for instance, factors) and gave either meaningless results or confusing error messages. Fixed functions include
beals,designdist,diversity,gdispweight,indpower,spantree,specpool,tsallis,tsallisaccumandvegdist. See github issue #292.envfitwith vectors could fail with missing data.The original data were not scaled and centred similarly as simulations in
simulate.rdawhen several simulations were returned as asimmatobject (which is compatible withnullmodelsimulations and can be used inoecosimu).
New Features
anosimchecks its input to avoid confusing error messages like that reported in https://stackoverflow.com/questions/52082743/.Broken-stick distribution (function
bstick) is no longer calculated for distance-based Redundancy Analysis (dbrda) with negative eigenvalues, because it is not clear how this should be done. Nowdbrdaandcapscaleare similar with this respect.printfunction forbetadisperresults gained new argumentneigento select the number of eigenvalues shown. Theprintis more robust when the number of eigenvalues is lower than the requestedneigen.
Deprecated
- Function
humpfitwas moved to the natto package and is still available from https://github.com/jarioksa/natto. It is scheduled for complete removal in vegan 2.6-0.
vegan 2.5-2
CRAN release: 2018-05-17
Installation and Compatibility
Vegan declares dependence on R version 3.2.0. This dependence was not yet noticed in the previous vegan release. However, the generic
sigmafunction was only defined in R-3.3.0, and thereforesigma.ccaof vegan must be spelt out completely when using R-3.2.x. See discussion in issue #274.CRAN package klaR has function
rda, and when loaded together with vegan this clashes with veganrdafor Redundancy Analysis. Vegan tries to mitigate the problem. In most cases vegan functions will be used if vegan was loaded after klaR, and an error message is issued if klaR objects are handled with vegan functions. klaR is also tricked to print an informative message if it handles vegan objects. However, vegan namespace can be attached automatically at the start-up and then klaR functions will take precedence. This was reported as issue #277.Bioconductor package phyloseq has a problem with
vegdistfunction for dissimilarities. The problem can be fixed by re-installing phyloseq from its source package. If you cannot do this, you must either downgrade to vegan version 2.4-6 or wait till Bioconductor binary packages are upgraded. This was reported in https://stackoverflow.com/questions/49882886/, and as vegan issue #272, and as phyloseq issues #918 and #921.
Bug Fixes
Plotting
betadisperfailed if any of thegroupshad only one member. Reported in https://stackoverflow.com/questions/50267430/.Permutation tests for constrained ordination (
anova.cca,permutest.cca) could fail in parallel processing with socket clusters. Socket clusters are always used in Windows and they can also be used in other operating systems when created withmakeCluster. See issue #276.
vegan 2.5-1
CRAN release: 2018-04-14
GENERAL
This is a major new release with changes all over the package: Nearly 40% of program files were changed from the previous release. Please report regressions and other issues in https://github.com/vegandevs/vegan/issues/.
Compiled code is used much more extensively, and most compiled functions use
.Callinterface. This gives smaller memory footprint and is also faster. In wall clock time, the greatest gains are in permutation tests for constrained ordination methods (anova.cca) and binary null models (nullmodel).Constrained ordination functions (
cca,rda,dbrda,capscale) are completely rewritten and share most of their code. This makes them more consistent with each other and more robust. The internal structure changed in constrained ordination objects, and scripts may fail if they try to access the result object directly. There never was a guarantee for unchanged internal structure, and such scripts should be changed and they should use the provided support functions to access the result object (see documentation ofcca.objectand github issue #262). Some support and analysis functions may no longer work with result objects created in previous vegan versions. You should useupdate(old.result.object)to fix these old result objects. See github issues #218, #227.vegan includes some tests that are run when checking the package installation. See github issues #181, #271.
The informative messages (warnings, notes and error messages) are cleaned and unified which also makes possible to provide translations.
New Functions
avgdist: new function to find averaged dissimilarities from several random rarefactions of communities. Code by Geoffrey Hannigan. See github issues #242, #243, #246.chaodist: new function that is similar todesigndist, but uses Chao terms that are supposed to take into account the effects of unseen species (Chao et al., Ecology Letters 8, 148-159; 2005). Earlier we had Jaccard-type Chao dissimilarity invegdist, but the new code allows defining any kind of Chao dissimilarity.New functions to find influence statistics of constrained ordination objects:
hatvalues,sigma,rstandard,rstudent,cooks.distance,SSD,vcov,df.residual. Some of these could be earlier found viaas.mlmfunction which is deprecated. See github issue #234.boxplotwas added forpermustatsresults to display the (standardized) effect sizes.sppscores: new function to add or replace species scores in distance-based ordination such asdbrda,capscaleandmetaMDS. Earlierdbrdadid not have species scores, and species scores incapscaleandmetaMDSwere based on raw input data which may not be consistent with the used dissimilarity measure. See github issue #254.cutreeord: new function that is similar tostats::cutree, but numbers the cluster in the order they appear in the dendrogram (left to right) instead of labelling them in the order they appeared in the data.sipoo.map: a new data set of locations and sizes of the islands in the Sipoo archipelago bird data setsipoo.
New Features in Constrained Ordination
The inertia of Correspondence Analysis (
cca) is called “scaled Chi-square” instead of using a name of a little known statistic.If elements for Constraints and Conditions are data frames in non-formula call of
rdaorcca, these are automatically expanded to model matrices and can contain factor variables. Earlier they had to be numerical model matrices and factors could only be used with the formula interface.Regression scores for constraints can be extracted and plotted for constrained ordination methods. See github issue #226.
Full model (
model = "full") is again enabled in permutations tests for constrained ordination results inanova.ccaandpermutest.cca.permutest.ccagained a new optionby = "onedf"to perform tests by sequential one degree-of-freedom contrasts of factors. This option is not (yet) enabled inanova.cca.The permutation tests are more robust, and most scoping issues should have been fixed.
Permutation tests use compiled C code and they are much faster. See github issue #211.
permutestprinted layout is similar toanova.cca.eigenvalsgained a new argument (model) to select either constrained or unconstrained scores. The old argument (constrained) is deprecated. See github issue #207.summary.eigenvalsreturns a matrix instead of a list containing only that matrix.Adjusted R2 is not calculated for partial ordination, because it is unclear how this should be done (function
RsquareAdj).ordiresidscan display standardized and studentized residuals.Function to construct
model.frameandmodel.matrixfor constrained ordination are more robust and fail in fewer cases.goodnessandinertcompfor constrained ordination result object no longer has an option to find distances: only explained variation is available.inertcompgained argumentunity. This will give “local contributions to beta-diversity” (LCBD) and “species contribution to beta-diversity” (SCBD) of Legendre & De Cáceres (Ecology Letters 16, 951-963; 2012).goodnessis disabled forcapscale.prcgained argumentconstfor general scaling of results similarly as inrda.prcuses regression scores for Canoco-compatibility.
New Features in Null Model Communities
The C code for swap-based binary null models was made more efficients, and the models are all faster. Many of these models selected a 2 times 2 submatrix, and for this they generated four random numbers (two rows, two columns). Now we skip selecting third or fourth random number if it is obvious that the matrix cannot be swapped. Since most of time was used in generating random numbers in these functions, and most candidates were rejected, this speeds up functions. However, this also means that random number sequences change from previous vegan versions, and old binary model results cannot be replicated exactly. See github issues #197, #255 for details and timing.
Ecological null models (
nullmodel,simulate,make.commsim,oecosimu) gained new null model"greedyqswap"which can radically speed up quasi-swap models with minimal risk of introducing bias.Backtracking is written in C and it is much faster. However, backtracking models are biased, and they are provided only because they are classic legacy models.
New Features in Other Functions
adonis2gained a column of R2 similarly as oldadonis.Great part of R code for
decoranais written in C which makes it faster and reduces the memory footprint.metaMDSresults gained newpointsandtextmethods.ordiplotand other ordinationplotfunctions can be chained with theirpointsandtextfunctions allowing the use of magrittr pipes. Thepointsandtextfunctions gained argument to draw arrows allowing their use in drawing biplots or adding vectors of environmental variables withordiplot. Since many ordinationplotmethods return an invisible"ordiplot"object, thesepointsandtextmethods also work with them. See github issue #257.Lattice graphics (
ordixyplot) for ordination can add polygons that enclose all points in the panel and complete data.ordiclustergained option to suppress drawing in plots so that it can be more easily embedded in other functions for calculations.as.radreturns the index of included taxa as an attribute.Random rarefaction (function
rrarefy) uses compiled C code and is much faster.plotofspecaccumcan draw short horizontal bars to vertical error bars. See https://stackoverflow.com/questions/45378751.decostandgained new standardization methodsrankandrrankwhich replace abundance values by their ranks or relative ranks. See github issue #225.Clark dissimilarity was added to
vegdist(this cannot be calculated withdesigndist).designdistevaluates minimum terms in compiled code, and the function is faster thanvegdistalso for dissimilarities using minimum terms. Althoughdesigndistis usually faster thanvegdist, it is numerically less stable, in particular with large data sets.swanpassestypeargument tobeals.tabascocan use traditional cover scale values from functioncoverscale. Functioncoverscalecan return scaled values as integers for numerical analysis instead of returning characters for printing.varpartcan partition Chi-squared inertia of correspondence analysis with new argumentchisquare. The adjusted R2 is based on permutation tests, and the replicate analysis will have random variation.The explanatory tables can be data frames with factors or single factors in
varpartand these will be automatically expanded to model matrices. Earlier factors could only be used with one-sided model formulae. Based on the code suggested by Daniel Borcard, Univ. Montréal.
Bug Fixes
Very long
Condition()statements (> 500 characters) failed in partial constrained ordination models (cca,rda,dbrda,capscale). The problem was detected in https://stackoverflow.com/questions/49249816.Labels were not adjusted when arrows were rescaled in
envfitplots. See https://stackoverflow.com/questions/49259747.ordiArrowMulfailed if there was only one arrow to be plotted inenvfit.
Deprecated and Defunct
as.mlmfunction for constrained correspondence analysis is deprecated in favour of new functions that directly give the influence statistics. See github issue #234.commsimulatoris now defunct: usesimulatefornullmodelobjects.ade4
ccaobjects are no longer handled in vegan: ade4 has had noccasince version 1.7-8 (August 9, 2017).
vegan 2.4-6
CRAN release: 2018-01-24
Installation and Building
- CRAN packages are no longer allowed to use FORTRAN input, but
read.cepfunction used FORTRAN format to read legacy CEP and Canoco files. To avoid NOTEs and WARNINGs, the function was re-written in R. The newread.cepis less powerful and more fragile, and can only read data in “condensed” format, and it can fail in several cases that were successful with the old code. The old FORTRAN-based function is still available in cepreader. See github issue #263. The cepreader package is developed in https://github.com/vegandevs/cepreader.
Bug Fixes
- Some functions for rarefaction (
rrarefy), species abundance distribution (preston) and species pool (estimateR) need exact integer data, but the test allowed small fuzz. The functions worked correctly with original data, but if data were transformed and then back-transformed, they would pass the integer test with fuzz and give wrong results. For instance,sqrt(3)^2would pass the test as 3, but was interpreted strictly as integer 2. See github issue #259.
vegan 2.4-5
CRAN release: 2017-12-01
Bug Fixes
Several “Swap & Shuffle” null models generated wrong number of initial matrices. Usually they generated too many, which was not dangerous, but it was slow. However, random sequences will change with this fix.
Lattice graphics for ordination (
ordixyplotand friends) colour the arrows bygroupsinstead of randomly mixed colours.Information on constant or mirrored permutations was omitted when reporting permutation tests (e.g., in
anovafor constrained ordination).
New Features
ordistephas improved interpretation ofscope: if the lower scope is missing, the formula of the starting solution is taken as the lower scope instead of using an empty model. See https://stackoverflow.com/questions/46985029/.fitspecaccumgained new support functionsnobsandlogLikwhich allow better co-operation with other packages and functions. See GitHub issue #250.The “backtracking” null model for community simulation is faster. However, “backtracking” is a biased legacy model that should not be used except in comparative studies.
vegan 2.4-4
CRAN release: 2017-08-24
Bug Fixes
anova(..., by = "axis")for constrained ordination (cca,rda,dbrda) ignored partial terms inCondition().inertcompandsummary.ccafailed if the constrained component was defined, but explained nothing and had zero rank. See https://stackoverflow.com/questions/43683699/.Labels are no longer cropped in the
meandistplots.
New Features
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, Methods Ecol Evol 2, 269–277 (2011) who regarded marginal tests as unbiased.
Canberra distance in
vegdistcan now handle negative input entries similarly as latest versions of R.
vegan 2.4-3
CRAN release: 2017-04-07
Installation and Building
vegan registers native C and Fortran routines. This avoids warnings in model checking, and may also give a small gain in speed.
Future versions of vegan will deprecate and remove elements
pCCA$Fit,CCA$Xbar, andCA$Xbarfromccaresult objects. This release provides a new functionordiYbarwhich is able to construct these elements both from the current and future releases. Scripts and functions directly accessing these elements should switch toordiYbarfor smooth transition.
Bug Fixes
as.mlmmethods for constrained ordination include zero intercept to give the correct residual degrees of freedom for derived statistics.biplotmethod forrdapassescorrelationargument to the scaling algorithm.Biplot scores were wrongly centred in
ccawhich caused a small error in their values.-
Weighting and centring were corrected in
intersetcorandspenvcor. The fix can make a small difference when analysingccaresults.Partial models were not correctly handled in
intersetcor. envfitandordisurffunctions failed when applied to species scores.Non-standard variable names can be used within
Condition()in partial ordination. Partial models are used internally within several functions, and a problem was reported by Albin Meyer (Univ Lorraine, Metz, France) inordiR2stepwhen using a variable name that contained a hyphen (which was wrongly interpreted as a minus sign in partial ordination).ordispiderdid not pass graphical arguments when used to show the difference of LC and WA scores in constrained ordination.ordiR2stepuses onlyforwardselection to avoid several problems in model evaluation.tolerancefunction could returnNaNin some cases when it should have returned0. 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.
vegan 2.4-2
CRAN release: 2017-01-17
Bug Fixes
Permutation tests (
permutests,anova) for the first axis failed in constrained distance-based ordination (dbrda,capscale). Nowcapscalewill also throw away negative eigenvalues when first eigenvalues are tested. All permutation tests for the first axis are now faster. The problem was reported by Cleo Tebby and the fixes are discussed in GitHub issue #198 and pull request #199.Some support functions for
dbrdaorcapscalegave results or some of their components in wrong scale. Fixes instressplot,simulate,predictandfittedfunctions.intersetcordid not use correct weighting forccaand the results were slightly off.anovaandpermutestfailed whenbetadisperwas fitted with argumentbias.adjust = TRUE. Fixes Github issue #219 reported by Ross Cunning, O’ahu, Hawaii.ordiclustershould return invisibly only the coordinates of internal points (where clusters or points are joined), but last rows contained coordinates of external points (ordination scores of points).The
ccamethod oftolerancewas returning incorrect values for all but the second axis for sample heterogeneities and species tolerances. See issue #216 for details.
New Features
Biplot scores are scaled similarly as site scores in constrained ordination methods
cca,rda,capscaleanddbrda. Earlier they were unscaled (or more technically, had equal scaling on all axes).tabascoadds argument toscalethe colours by rows or columns in addition to the old equal scale over the whole plot. New argumentslabRowandlabCexcan be used to change the column or row labels. Function also takes care that only above-zero observations are coloured: earlier tiny observed values were merged to zeros and were not distinct in the plots.Sequential null models are somewhat faster (up to 10%). Non-sequential null models may be marginally faster. These null models are generated by function
nullmodeland also used inoecosimu.vegdistis much faster. It used to be clearly slower thanstats::dist, but now it is nearly equally fast for the same dissimilarity measure.Handling of
data=in formula interface is more robust, and messages on user errors are improved. This fixes points raised in Github issue #200.The families and orders in
dune.taxonwere updated to APG IV (Bot J Linnean Soc 181, 1–20; 2016) and a corresponding classification for higher levels (Chase & Reveal, Bot J Linnean Soc 161, 122-127; 2009).
vegan 2.4-1
CRAN release: 2016-09-07
Installation
- Fortran code was modernized to avoid warnings in latest R. The modernization should have no visible effect in functions. Please report all suspect cases as vegan issues.
Bug Fixes
Several support functions for ordination methods failed if the solution had only one ordination axis, for instance, if there was only one constraining variable in CCA, RDA and friends. This concerned
goodnessfor constrained ordination,inertcomp,fittedforcapscale,stressplotfor RDA, CCA (GitHub issue #189).goodnessfor CCA & friends ignoredchoicesargument (GitHub issue #190).goodnessfunction did not consider negative eigenvalues of db-RDA (functiondbrda).Function
meandistfailed in some cases when one of the groups had only one observation.linestackcould not handle expressions inlabels. This regression is discussed in GitHub issue #195.Nestedness measures
nestedbetajacandnestedbetasorexpecting binary data did not cope with quantitative input in evaluating Baselga’s matrix-wide Jaccard or Sørensen dissimilarity indices.Function
as.mcmcto castoecosimuresult to an MCMC object (coda package) failed if there was only one chain.
New Features
diversityfunction returns nowNAif the observation hadNAvalues instead of returning0. The function also checks the input and refuses to handle data with negative values. GitHub issue #187.rarefyfunction will work more robustly in marginal case when the user asks for only one individual which can only be one species with zero variance.Several functions are more robust if their factor arguments contain missing values (
NA):betadisper,adipart,multipart,hiersimu,envfitand constrained ordination methodscca,rda,capscaleanddbrda. GitHub issues #192 and #193.
vegan 2.4-0
CRAN release: 2016-06-15
Distance-based Analysis
Distance-based methods were redesigned and made consistent for ordination (
capscale, newdbrda), permutational ANOVA (adonis, newadonis2), multivariate dispersion (betadisper) and variation partitioning (varpart). These methods can produce negative eigenvalues with several popular semimetric dissimilarity indices, and they were not handled similarly by all functions. Now all functions are designed after McArdle & Anderson (Ecology 82, 290–297; 2001).dbrdais a new function for distance-based Redundancy Analysis following McArdle & Anderson (Ecology 82, 290–297; 2001). With metric dissimilarities, the function is equivalent to oldcapscale, but negative eigenvalues of semimetric indices are handled differently. Indbrdathe dissimilarities are decomposed directly into conditions, constraints and residuals with their negative eigenvalues, and any of the components can have imaginary dimensions. Function is mostly compatible withcapscaleand other constrained ordination methods, but full compatibility cannot be achieved (see issue #140 in Github). The function is based on the code by Pierre Legendre.-
The old
capscalefunction for constrained ordination is still based only on real components, but the total inertia of the components is assessed similarly as indbrda.The significance tests will differ from the previous version, but function
oldCapscalewill cast thecapscaleresult to a similar form as previously. adonis2is a new function for permutational ANOVA of dissimilarities. It is based on the same algorithm as thedbrda. The function can perform overall tests of all independent variables as well as sequential and marginal tests of each term. The oldadonisis still available, but it can only perform sequential tests. With same settings,adonisandadonis2give identical results (but see Github issue #156 for differences).Function
varpartcan partition dissimilarities using the same algorithm asdbrda.Argument
sqrt.disttakes square roots of dissimilarities and these can change many popular semimetric indices to metric distances incapscale,dbrda,wcmdscale,adonis2,varpartandbetadisper(issue #179 in Github).Lingoes and Cailliez adjustments change any dissimilarity into metric distance in
capscale,dbrda,adonis2,varpart,betadisperandwcmdscale. Earlier we had only Cailliez adjustment incapscale(issue #179 in Github).RsquareAdjworks withcapscaleanddbrdaand this allows usingordiR2stepin model building.
Bug Fixes
-
specaccum:plotfailed if line type (lty) was given. Reported by Lila Nath Sharma (Univ Bergen, Norway)
New Functions
ordibaris a new function to draw crosses of standard deviations or standard errors in ordination diagrams instead of corresponding ellipses.Several
permustatsresults can be combined with a newc()function.New function
smbindbinds together null models by row, column or replication. If sequential models are bound together, they can be treated as parallel chains in subsequent analysis (e.g., afteras.mcmc). See issue #164 in Github.
New Features
-
Null model analysis was upgraded:
New
"curveball"algorithm provides a fast null model with fixed row and column sums for binary matrices after Strona et al. (Nature Commun. 5: 4114; 2014).The
"quasiswap"algorithm gained argumentthinwhich can reduce the bias of null models."backtracking"is now much faster, but it is still very slow, and provided mainly to allow comparison against better and faster methods.Compiled code can now be interrupted in null model simulations.
designdistcan now use beta diversity notation (gamma,alpha) for easier definition of beta diversity indices.-
metaMDShas new iteration strategy: Argumenttrygives the minimum number of random starts, andtrymaxthe maximum number. Earlier we only handtrywhich gave the maximum number, but now we run at leasttrytimes. This reduces the risk of being trapped in a local optimum (issue #154 in Github).If there were no convergent solutions,
metaMDSwill now tabulate stopping criteria (iftrace = TRUE). This can help in deciding if any of the criteria should be made more stringent or the number of iterations increased. The documentation formonoMDSandmetaMDSgive more detailed information on convergence criteria. -
The
summaryofpermustatsprints now P-values, and the test direction (alternative) can be changed.The
qqmathfunction ofpermustatscan now plot standardized statistics. This is a partial solution to issue #172 in Github. MDSrotatecan rotate ordination to show maximum separation of factor levels (classes) using linear discriminant analysis (ldain MASS package).adipart,hiersimuandmultipartexpose argumentmethodto specify the null model.RsquareAdjworks withccaand this allows usingordiR2stepin model building. The code was developed by Dan McGlinn (issue #161 in Github). However,ccastill cannot be used invarpart.-
ordiellipseandordihullallow setting colours, line types and other graphical parameters.The alpha channel can now be given also as a real number in 0 … 1 in addition to integer 0 … 255.
ordiellipsecan now draw ellipsoid hulls that enclose points in a group.ordicluster,ordisegments,ordispiderandlinesandplotfunctions forisomapandspantreecan use a mixture of colours of connected points. Their behaviour is similar as in analogous functions in the the vegan3d package.plotofbetadisperis more configurable. See issues #128 and #166 in Github for details.textandpointsmethods fororditkplotrespect stored graphical parameters.Environmental data for the Barro Colorado Island forest plots gained new variables from Harms et al. (J. Ecol. 89, 947–959; 2001). Issue #178 in Github.
Deprecated and Defunct
Function
metaMDSrotatewas removed and replaced withMDSrotate.densityanddensityplotmethods for various vegan objects were deprecated and replaced withdensityanddensityplotforpermustats. Functionpermustatscan extract the permutation and simulation results of vegan result objects.
vegan 2.3-4
CRAN release: 2016-02-26
Bug Fixes
betadiverindex19had wrong sign in one of its terms.linestackfailed when thelabelswere given, but the input scores had no names. Reported by Jeff Wood (ANU, Canberra, ACT).
Deprecated
-
vegandocsis deprecated. Current R provides better tools for seeing extra documentation (news()andbrowseVignettes()).
vegan 2.3-3
CRAN release: 2016-01-12
Bug Fixes
metaMDSandmonoMDScould fail if input dissimilarities were huge: in the reported case they were of magnitude 1E85. Fixes issue #152 in Github.Permutations failed if they were defined as permute control structures in
estaccum,ordiareatest,renyiaccumandtsallisaccum. Reported by Dan Gafta (Cluj-Napoca) forrenyiaccum.rarefygave false warnings if input was a vector or a single sampling unit.Some extrapolated richness indices in
specpoolneeded the number of doubletons (= number of species occurring in two sampling units), and these failed when only one sampling unit was supplied. The extrapolated richness cannot be estimated from a single sampling unit, but now such cases are handled smoothly instead of failing: observed non-extrapolated richness with zero standard error will be reported. The issue was reported in https://stackoverflow.com/questions/34027496/.
New Features
treedistandtreediverefuse to handle trees with reversals, i.e, higher levels are more homogeneous than lower levels. Functiontreeheightwill estimate their total height with absolute values of branch lengths. Functiontreediverefuses to handle trees with negative branch heights indicating negative dissimilarities. Functiontreediveis faster.gdispweightworks when input data are in a matrix instead of a data frame.Input dissimilarities supplied in symmetric matrices or data frames are more robustly recognized by
anosim,bioenvandmrpp.
vegan 2.3-2
CRAN release: 2015-11-19
Bug Fixes
Printing details of a gridded permutation design would fail when the grid was at the within-plot level.
ordiclusterjoined the branches at wrong coordinates in some cases.ordiellipseignored weights when calculating standard errors (kind = "se"). This influenced plots ofcca, and also influencedordiareatest.
New Features
adonisandcapscalefunctions recognize symmetric square matrices as dissimilarities. Formerly dissimilarities had to be given as"dist"objects such as produced bydistorvegdistfunctions, and data frames and matrices were regarded as observations x variables data which could confuse users (e.g., issue #147).msoaccepts"dist"objects for the distances among locations as an alternative to coordinates of locations.text,pointsandlinesfunctions forprocrustesanalysis gained new argumenttruemeanwhich allows addingprocrustesitems to the plots of original analysis.rrarefyreturns observed non-rarefied communities (with a warning) when users request subsamples that are larger than the observed community instead of failing. Functiondrarefyhas been similar and returned sampling probabilities of 1, but now it also issues a warning. Fixes issue #144 in Github.
vegan 2.3-1
CRAN release: 2015-09-25
Bug Fixes
Permutation tests did not always correctly recognize ties with the observed statistic and this could result in too low
P-values. This would happen in particular when all predictor variables were factors (classes). The changes concern functionsadonis,anosim,anovaandpermutestfunctions forcca,rdaandcapscale,permutestforbetadisper,envfit,mantelandmantel.partial,mrpp,mso,oecosimu,ordiareatest,protestandsimper. This also fixes issues #120 and #132 in GitHub.Automated model building in constrained ordination (
cca,rda,capscale) withstep,ordistepandordiR2stepcould fail if there were aliased candidate variables, or constraints that were completely explained by other variables already in the model. This was a regression introduced in vegan 2.2-0.Constrained ordination methods
cca,rdaandcapscaletreat character variables as factors in analysis, but did not return their centroids for plotting.Recovery of original data in
metaMDSwhen computing WA scores for species would fail if the expression supplied to argumentcommwas long & got deparsed to multiple strings.metaMDSdistnow returns the (possibly modified) data frame of community datacommas attribute"comm"of the returneddistobject.metaMDSnow uses this to compute the WA species scores for the NMDS. In addition, the deparsed expression forcommis now robust to long expressions. Reported by Richard Telford.metaMDSandmonoMDSrejected dissimilarities with missing values.Function
rarecurvedid not check its input and this could cause confusing error messages. Now function checks that input data are integers that can be interpreted as counts on individuals and all sampling units have some species. Unchecked bad inputs were the reason for problems reported in https://stackoverflow.com/questions/30856909/.
New Features and Functions
Scaling of ordination axes in
cca,rdaandcapscalecan now be expressed with descriptive strings"none","sites","species"or"symmetric"to tell which kind of scores should be scaled by eigenvalues. These can be further modified with argumentshillinccaandcorrelationinrda. The old numeric scaling can still be used.The permutation data can be extracted from
anovaresults of constrained ordination (cca,rda,capscale) and further analysed withpermustatsfunction.New data set
BCI.envof site information for the Barro Colorado Island tree community data. Most useful variables are the UTM coordinates of sample plots. Other variables are constant or nearly constant and of little use in normal analysis.
vegan 2.3-0
CRAN release: 2015-05-26
Bug Fixes
Constrained ordination functions
cca,rdaandcapscaleare 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 #16 and #100 in GitHub.Ordination functions
ccaandrdasilently accepted dissimilarities as input although their analysis makes no sense with these methods. Dissimilarities should be analysed with distance-based redundancy analysis (capscale).The variance of the conditional component was over-estimated in
goodnessofrdaresults, and results were wrong for partial RDA. The problems were reported in an R-sig-ecology message by Christoph von Redwitz.
Windows
-
orditkplotdid not add file type identifier to saved graphics in Windows although that is required. The problem only concerned Windows OS.
New Features and Functions
goodnessfunction for constrained ordination (cca,rda,capscale) was redesigned. Function gained argumentaddpreviousto add the variation explained by previous ordination components to axes whenstatistic = "explained". With this option,model = "CCA"will include the variation explained by partialled-out conditions, andmodel = "CA"will include the accumulated variation explained by conditions and constraints. The former behaviour wasaddprevious = TRUEformodel = "CCA", andaddprevious = FALSEformodel = "CA". The argument will have no effect whenstatistic = "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.Functions
ordiArrowMulandordiArrowTextXYare 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 vegan functions.orditkplotcan export graphics in SVG format. SVG is a vector graphics format which can be edited with several external programs, such as Illustrator and Inkscape.-
Rarefaction curve (
rarecurve) and species accumulation models (specaccum,fitspecaccum) gained new functions to estimate the slope of curve at given location. Originally this was based on a response to an R-SIG-ecology query. For rarefaction curves, the function israreslope, and for species accumulation models it isspecslope.The functions are based on analytic equations, and can also be evaluated at interpolated non-integer values. In
specaccummodels the functions can be only evaluated for analytic models"exact","rarefaction"and"coleman". With"random"and"collector"methods you can only use finite differences (diff(fitted(<result.object>))). Analytic functions for slope are used for all non-linear regression models known tofitspecaccum. Species accumulation models (
specaccum) and non-liner regression models for species accumulation (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. Thepredictmodels also use the number of sites withnewdata, 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.fitspecaccumgained support functionsAICanddeviance.The
varpartplots of four-component models were redesigned following Legendre, Borcard & Roberts 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.
vegan 2.2-1
CRAN release: 2015-01-12
General
- This is a maintenance release to avoid warning messages caused by changes in CRAN repository. The namespace usage is also more stringent to avoid warnings and notes in development versions of R.
Installation
- vegan can be installed and loaded without tcltk package. The tcltk package is needed in
orditkplotfunction for interactive editing of ordination graphics.
New Features
estimateRuses a more exact variance formula for bias-corrected Chao estimate of extrapolated number of species. The new formula may be unpublished, but it was derived following the guidelines of Chiu, Wang, Walther & Chao, Biometrics 70, 671–682 (2014), doi:10.1111/biom.12200, online supplementary material.Diversity accumulation functions
specaccum,renyiaccum,tsallisaccum,poolaccumandestaccumRuse now permute package for permutations of the order of sampling sites. Normally these functions only need simple random permutation of sites, but restricted permutation of the permute package and user-supplied permutation matrices can be used.estaccumRfunction can use parallel processing.linestackaccepts now expressions as labels. This allows using mathematical symbols and formula given as mathematical expressions.
vegan 2.2-0
CRAN release: 2014-11-17
General
-
Several vegan functions can now use parallel processing for slow and repeating calculations. All these functions have argument
parallel. The argument can be an integer giving the number of parallel processes. In unix-alikes (Mac OS, Linux) this will launch"multicore"processing and in Windows it will set up"snow"clusters as desribed in the documentation of the parallel package. Ifoption"mc.cores"is set to an integer > 1, this will be used to automatically start parallel processing. Finally, the argument can also be a previously set up"snow"cluster which will be used both in Windows and in unix-alikes. Vegan vignette on Design decision explains the implementation (usevegandocs("decission"), and parallel package has more extensive documentation on parallel processing in R.The following function use parallel processing in analysing permutation statistics:
adonis,anosim,anova.cca(andpermutest.cca),mantel(andmantel.partial),mrpp,ordiareatest,permutest.betadisperandsimper. In addition,bioenvcan compare several candidate sets of models in paralle,metaMDScan launch several random starts in parallel, andoecosimucan evaluate test statistics for several null models in parallel. -
All permutation tests are based on the permute package which offers strong tools for restricted permutation. All these functions have argument
permutations. The default usage of simple non-restricted permutations is achieved by giving a single integer number. Restricted permutations can be defined using thehowfunction of the permute package. Finally, the argument can be a permutation matrix where rows define permutations. It is possible to use external or user constructed permutations.See
help(permutations)for a brief introduction on permutations in vegan, and permute package for the full documention. The vignette of the permute package can be read from vegan with commandvegandocs("permutations").The following functions use the permute package:
CCorA,adonis,anosim,anova.cca(plus associatedpermutest.cca,add1.cca,drop1.cca,ordistep,ordiR2step),envfit(plus associatedfactorfitandvectorfit),mantel(andmantel.partial),mrpp,mso,ordiareatest,permutest.betadisper,protestandsimper. Community null model generation has been completely redesigned and rewritten. The communities are constructed with new
nullmodelfunction and defined in a low levelcommsimfunction. The actual null models are generated with asimulatefunction that builds an array of null models. The new null models include a wide array of quantitative models in addition to the old binary models, and users can plug in their own generating functions. The basic tool invoking and analysing null models isoecosimu. The null models are often used only for the analysis of nestedness, but the implementation inoecosimuallows analysing any statistic, and null models are better seen as an alternative to permutation tests.
Installation
vegan package dependencies and namespace imports were adapted to changes in R, and no more trigger warnings and notes in package tests.
Three-dimensional ordination graphics using scatterplot3d for static plots and rgl for dynamic plots were removed from vegan and moved to a companion package vegan3d. The package is available in CRAN.
New Functions
Function
dispweightimplements dispersion weighting of Clarke et al. (Marine Ecology Progress Series, 320, 11–27). In addition, we implemented a new method for generalized dispersion weightinggdispweight. Both methods downweight species that are significantly over-dispersed.New
hclustsupport functionsreorder,revandscores. Functionsreorderandrevare similar as these functions fordendrogramobjects in base R. However,reordercan use (and defaults to) weighted mean. In weighted mean the node average is always the mean of member leaves, whereas thedendrogramuses always unweighted means of joined branches.Function
ordiareatestsupplementsordihullandordiellipseand provides a randomization test for the one-sided alternative hypothesis that convex hulls or ellipses in two-dimensional ordination space have smaller areas than with randomized groups.Function
permustatsextracts and inspects permutation results with support functionssummary,density,densityplot,qqnormandqqmath. Thedensityandqqnormare standard R tools that only work with one statistic, anddensityplotandqqmathare lattice graphics that work with univariate and multivariate statistics. The results of following functions can be extracted:anosim,adonis,mantel(andmantel.partial),mrpp,oecosimu,permustest.cca(but not the correspondinganovamethods),permutest.betadisper, andprotest.stressplotfunctions display the ordination distances at given number of dimensions against original distances. The method functins are similar tostressplotformetaMDS, and always use the inherent distances of each ordination method. The functions are available for the resultscapscale,cca,princomp,prcomp,rda, andwcmdscale.
Bug Fixes
cascadeKMof only one group will beNAinstead of a random value.ordiellipsecan handle points exactly on a line, including only two points (with a warning).plotting
radfitresults for several species failed if any of the communities had no species or had only one species.RsquareAdjforcapscalewith negative eigenvalues will now reportNAinstead of using biased method ofrdaresults.simperfailed when a group had only a single member.
New Features
anova.ccafunctions were re-written to use the permute package. Old results may not be exactly reproduced, and models with missing data may fail in several cases. There is a new option of analysing a sequence of models against each other.simulatefunctions forccaandrdacan return several simulations in anullmodelcompatible object. The functions can produce simulations with correlated errors (also forcapscale) in parametric simulation with Gaussian error.bioenvcan use Manhattan, Gower and Mahalanobis distances in addition to the default Euclidean. New helper functionbioenvdistcan extract the dissimilarities applied in best model or any other model.metaMDS(..., trace = 2)will show convergence information with the defaultmonoMDSengine.Function
MDSrotatecan rotate ak-dimensional ordination tok-1variables. When these variables are correlated (like usually is the case), the vectors can also be correlated to previously rotated dimensions, but will be uncorrelated to all later ones.vegan 2.0-10 changed the weighted
nestednodfso that weighted analysis of binary data was equivalent to binary analysis. However, this broke the equivalence to the original method. Now the function has an argumentwbinaryto select the method of analysis. The problem was reported and a fix submitted by Vanderlei Debastiani (Universidade Federal do Rio Grande do Sul, Brasil).ordiellipse,ordihullandordiellipsecan handle missing values ingroups.ordispidercan now use spatial medians instead of means.rankindexcan use Manhattan, Gower and Mahalanobis distance in addition to the default Euclidean.User can set colours and line types in function
rarecurvefor plotting rarefaction curves.spantreegained a support functionas.hclustto change the minimum spanning tree into anhclusttree.fitspecaccumcan do weighted analysis. Gainedlinesmethod.-
Functions for extrapolated number of species or for the size of species pool using Chao method were modified following Chiu et al., Biometrics 70, 671–682 (2014).
Incidence based
specpoolcan now use (and defaults to) small sample correction with number of sites as the sample size. Function uses basic Chao extrapolation based on the ratio of singletons and doubletons, but switches now to bias corrected Chao extrapolation if there are no doubletons (species found twice). The variance formula for bias corrected Chao was derived following the supporting on line material of doi:10.1111/biom.12200 and differs slightly from Chiu et al. (2014).The
poolaccumfunction was changed similarly, but the small sample correction is used always.The abundance based
estimateRuses bias corrected Chao extrapolation, but earlier it estimated its variance with classic Chao model. Now we use the widespread approximate estimate from EstimateS for variance.With these changes these functions are more similar to EstimateS
tabascouses nowreorder.hclustforhclustobject for better ordering than previously when it cast trees todendrogramobjects.treediveandtreedistdefault now tomatch.force = TRUEand can be silenced withverbose = FALSE.vegdistgained Mahalanobis distance.Nomenclature updated in plant community data with the help of Taxonstand and taxize packages. The taxonomy of the
dunedata was adapted to the same sources and APG III.varespecandduneuse 8-character names (4 from genus + 4 from species epithet). New data set on phylogenetic distances fordunewas extracted from Zanne et al. (Nature 506, 89–92; 2014).User configurable plots for
rarecurve.
Deprecated and Defunct
strataare deprecated in permutations. It is still accepted but will be phased out in next releases. Usehowof permute package.cca,rdaandcapscaledo not return scores scaled by eigenvalues: usescoresfunction to extract scaled results.commsimulatoris deprecated. Replacecommsimulator(x, method)withsimulate(nullmodel(x, method)).densityanddensityplotfor permutation results are deprecated: usepermustatswith itsdensityanddensityplotmethod.
vegan 2.0-10
CRAN release: 2013-12-12
General
- This version is adapted to the changes in permute package version 0.8-0 and no more triggers NOTEs in package checks. This release may be the last of the 2.0 series, and the next vegan release is scheduled to be a major release with newly designed
oecosimuand community pattern simulation, support for parallel processing, and full support of the permute package. If you are interested in these developments, you may try the development versions of vegan in GitHub and report the problems and user experience to us.
Bug Fixes
envfitfunction assumed that all external variables were either numeric or factors, and failed if they were, say, character strings. Now only numeric variables are taken as continuous vectors, and all other variables (character strings, logical) are coerced to factors if possible. The function also should work with degenerate data, like only one level of a factor or a constant value of a continuous environmental variable. The ties were wrongly in assessing permutationP-values invectorfit.nestednodfwith quantitative data was not consistent with binary models, and the fill was wrongly calculated with quantitative data.oecosimunow correctly adapts displayed quantiles of simulated values to thealternativetest direction.renyiaccumplotting failed if only one level of diversityscalewas used.
New Features
The Kempton and Taylor algorithm was found unreliable in
fisherfitandfisher.alpha, and now the estimation of Fisher α is only based on the number of species and the number of individuals. The estimation of standard errors and profile confidence intervals also had to be scrapped.renyiaccum,specaccumandtsallisaccumfunctions gainedsubsetargument.renyiaccumcan now add acollectorcurve to to the analysis. The collector curve is the diversity accumulation in the order of the sampling units. With an interesting ordering or sampling units this allows comparing actual species accumulations with the expected randomized accumulation.specaccumcan now perform weighted accumulation using the sampling effort as weights.
vegan 2.0-9
CRAN release: 2013-09-25
- This version is released due to changes in programming interface and testing procedures in R 3.0.2. If you are using an older version of R, there is no need to upgrade vegan. There are no new features nor bug fixes. The only user-visible changes are in documentation and in output messages and formatting. Because of R changes, this version is dependent on R version 2.14.0 or newer and on lattice package.
vegan 2.0-8
CRAN release: 2013-07-10
General
- This is a maintenance release that fixes some issues raised by changed in R toolset for processing vignettes. In the same we also fix some typographic issues in the vignettes.
New Features
-
ordisurfgained new arguments for more flexible definition of fitted models to better utilize the mgcv::gamfunction.The linewidth of contours can now be set with the argument
lwd. Labels to arrows are positioned in a better way in
plotfunctions for the results ofenvfit,cca,rdaandcapscale. The labels should no longer overlap the arrow tips.The setting test direction is clearer in
oecosimu.ordipointlabelgained aplotmethod that can be used to replot the saved result.
vegan 2.0-7
CRAN release: 2013-03-19
New Functions
-
tabasco()is a new function for graphical display of community data matrix. Technically it is an interface to Rheatmap, but its use is closer to vegan functionvegemite. The function can reorder the community data matrix similarly asvegemite, for instance, by ordination results. Unlikeheatmap, it only displays dendrograms if supplied by the user, and it defaults to re-order the dendrograms by correspondence analysis. Species are ordered to match site ordering or like determined by the user.
Bug Fixes
Function
fitspecaccum(..., model = "asymp")fitted logistic model instead of asymptotic model (or the same asmodel = "logis").nestedtemp()failed with very sparse data (fill< 0.38%).
New Features
The
plotfunction for constrained ordination results (cca,rda,capscale) gained argumentaxis.bp(defaultsTRUE) which can be used to suppress axis scale for biplot arrays.Number of iterations in nonmetric multidimensional scaling (NMDS) can be set with keyword
maxit(defaults200) inmetaMDS.
Deprecated
- The result objects of
cca,rdaandcapscalewill no longer have scoresu.eig,v.eigandwa.eigin the future versions of vegan. This change does not influence normal usage, because vegan functions do not need these items. However, external scripts and packages may need changes in the future versions of vegan.
vegan 2.0-6
CRAN release: 2013-02-11
Bug Fixes
The species scores were scaled wrongly in
capscale(). They were scaled correctly only when Euclidean distances were used, but usuallycapscale()is used with non-Euclidean distances. Most graphics will change and should be redone. The change of scaling mainly influences the spread of species scores with respect to the site scores.Function
clamtest()failed to set the minimum abundance threshold in some cases. In addition, the output was wrong when some of the possible species groups were missing. Both problems were reported by Richard Telford (Bergen, Norway).Plotting an object fitted by
envfit()would fail ifp.maxwas used and there were unused levels for one or more factors. The unused levels could result from deletion of observations with missing values or simply as the result of supplying a subset of a larger data set toenvfit().multipart()printed wrong information about the analysis type (but did the analysis correctly). Reported by Valerie Coudrain.oecosimu()failed if itsnestedfunreturned a data frame. A more fundamental fix will be in vegan 2.2-0, where the structure of theoecosimu()result will change.The plot of two-dimensional
procrustes()solutions often draw original axes in a wrong angle. The problem was reported by Elizabeth Ottesen (MIT).Function
treedive()for functional or phylogenetic diversity did not correctly match the species names between the community data and species tree when the tree contained species that did not occur in the data. Related functiontreedist()for phylogenetic distances did not try to match the names at all.
New Features
The output of
capscale()displays the value of the additive constant when argumentadd = TRUEwas used.fitted()functions forcca(),rda()andcapscale()can now return conditioned (partial) component of the response: Argumentmodelgained a new alternativemodel = "pCCA".dispindmorisita()output gained a new column for Chi-squared based probabilities that the null hypothesis (random distribution) is true.metaMDS()andmonoMDS()have new default convergence criteria. Most importantly, scale factor of the gradient (sfgrmin) is stricter. The former limit was too slack with large data sets and iterations stopped early without getting close to the solution. In addition,scores()ignore now requests to dimensions beyond those calculated instead of failing, andscores()formetaMDS()results do not drop dimensions.msoplot()gainedlegendargument for positioning the legend.Nestedness function
nestednodf()gained aplotmethod.-
ordiR2step()gained new argumentR2scope(defaultsTRUE) which can be used to turn off the criterion of stopping when the adjusted R2 of the current model exceeds that of the scope. This option allows model building when thescopewould be overdetermined (number of predictors higher than number of observations).ordiR2step()now handles partial redundancy analysis (pRDA). orditorp()gained argumentselectto select the rows or columns of the results to display.-
protest()prints the standardized residual statistic squared m12 in addition to the squared Procrustes correlation R2. Both were calculated, but only the latter was displayed.Permutation tests are much faster in
protest(). Instead of calling repeatedlyprocrustes(), the goodness of fit statistic is evaluated within the function. wcmdscale()gained methods forprint,plotetc. of the results. These methods are only used if the fullwcmdscaleresult is returned with, e.g., argumenteig = TRUE. The default is still to return only a matrix of scores similarly as the standard R functioncmdscale(), and in that case the new methods are not used.
vegan 2.0-5
CRAN release: 2012-10-08
Bug Fixes
anova(<cca_object>, ...)failed withby = "axis"andby = "term". The bug was reported by Dr Sven Neulinger (Christian Albrecht University, Kiel, Germany).radlatticedid not honour argumentBIC = TRUE, but always displayed AIC.
New Functions
-
Most vegan functions with permutation tests have now a
densitymethod that can be used to find empirical probability distributions of permutations. There is a newplotmethod for these functions that displays both the density and the observed statistic. Thedensityfunction is available foradonis,anosim,mantel,mantel.partial,mrpp,permutest.ccaandprocrustes.Function
adoniscan return several statistics, and it has now adensityplotmethod (based on lattice).Function
oecosimualready haddensityanddensityplot, but they are now similar to other vegan methods, and also work withadipart,hiersimuandmultipart. radfitfunctions got apredictmethod that also accepts argumentsnewdataandtotalfor new ranks and site totals for prediction. The functions can also interpolate to non-integer “ranks”, and in some models also extrapolate.
New Features
Labels can now be set in the
plotofenvfitresults. The labels must be given in the same order that the function uses internally, and new support functionlabelscan be used to display the default labels in their correct order.Mantel tests (functions
mantelandmantel.partial) gained argumentna.rmwhich can be used to remove missing values. This options should be used with care: Permutation tests can be biased if the missing values were originally in matching or fixed positions.radfitresults can be consistently accessed with the same methods whether they were a single model for a single site, all models for a single site or all models for all sites in the data. All functions now have methodsAIC,coef,deviance,logLik,fitted,predictandresiduals.
Installation and Building
Building of vegan vignettes failed with the latest version of LaTeX (TeXLive 2012).
R versions later than 2.15-1 (including development version) report warnings and errors when installing and checking vegan, and you must upgrade vegan to this version. The warnings concern functions
cIndexKMandbetadisper, and the error occurs inbetadisper. These errors and warnings were triggered by internal changes in R.
vegan 2.0-4
CRAN release: 2012-06-19
Bug Fixes
adipartassumed constant gamma diversity in simulations when assessing theP-value. This could give biased results if the null model produces variable gamma diversities and optionweights = "prop"is used. The default null model ("r2dtable") and the default option (weights = "unif") were analysed correctly.anova(<prc-object>, by = "axis")and otherbycases failed due to ‘NAMESPACE’ issues.clamtestwrongly used frequencies instead of the counts when calculating sample coverage. No detectable differences were produced when rerunning examples from Chazdon et al. 2011 and vegan help page.envfitfailed with unused factor levels.predictforccaresults withtype = "response"ortype = "working"failed withnewdataif the number of rows did not match with the original data. Now thenewdatais ignored if it has a wrong number of rows. The number of rows must match because the results inccamust be weighted by original row totals. The problem did not concernrdaorcapscaleresults which do not need row weights. Reported by Glenn De’ath.
New Features
-
Functions for diversity partitioning (
adipart,hiersimuandmultipart) have nowformulaanddefaultmethods. Theformulamethod is identical to the previous functions, but thedefaultmethod can take two matrices as input.Functions
adipartandmultipartcan be used for fast and easy overall partitioning to alpha, beta and gamma diversities by omitting the argument describing the hierarchy. The method in
betadisperis biased with small sample sizes. The effects of the bias are strongest with unequal sample sizes. A bias adjusted version was developed by Adrian Stier and Ben Bolker, and can be invoked with argumentbias.adjust(defaults toFALSE).bioenvaccepts dissimilarities (or square matrices that can be interpreted as dissimilarities) as an alternative to community data. This allows using other dissimilarities than those available invegdist.plotfunction forenvfitresults gained new argumentbgthat can be used to set background colour for plotted labels.msoplotis more configurable, and allows, for instance, setting y-axis limits.Hulls and ellipses are now filled using semitransparent colours in
ordihullandordiellipse, and the user can set the degree of transparency with a new argumentalpha. The filled shapes are used when these functions are called with argumentdraw = "polygon". Functionordihullputs labels (with argumentlabel = TRUE) now in the real polygon centre.-
ordiplot3dreturns functionenvfit.convertand the projected location of theorigin. Together these can be used to addenvfitresults to existingordiplot3dplots.Equal aspect ratio cannot be set exactly in
ordiplot3dbecause underlying core routines do not allow this. Nowordiplot3dsets equal axis ranges, and the documents urge users to verify that the aspect ratio is reasonably equal and the graph looks like a cube. If the problems cannot be solved in the future,ordiplot3dmay be removed from next releases of vegan. Function
ordipointlabelgained argument toselectonly some of the items for plotting. The argument can be used only with one set of points.
vegan 2.0-3
CRAN release: 2012-03-03
New Functions
Added new nestedness functions
nestedbetasorandnestedbetajacthat implement multiple-site dissimilarity indices and their decomposition into turnover and nestedness components following Baselga (Global Ecology and Biogeography 19, 134–143; 2010).Added function
rarecurveto draw rarefaction curves for each row (sampling unit) of the input data, optionally with lines showing rarefied species richness with given sample size for each curve.Added function
simperthat implements “similarity percentages” of Clarke (Australian Journal of Ecology 18, 117–143; 1993). The method compares two or more groups and decomposes the average between-group Bray-Curtis dissimilarity index to contributions by individual species. The code was developed in GitHub by Eduard Szöcs (Uni Landau, Germany).
Bug Fixes
betadisper()failed when thegroupswas a factor with empty levels.Some constrained ordination methods and their support functions are more robust in border cases (completely aliased effects, saturated models, user requests for non-existng scores etc). Concerns
capscale,ordistep,varpart,plotfunction for constrained ordination, andanova(<cca.object>, by = "margin").The
scoresfunction formonoMDSdid not honourchoicesargument and hence dimensions could not be chosen inplot.The default
scoresmethod failed if the number of requested axes was higher than the ordination object had. This was reported as an error inordiplotin R-sig-ecology mailing list.
New Features
metaMDSargumentnoshare = 0is now regarded as a numeric threshold that always triggers extended dissimilarities (stepacross), instead of being treated as synonymous withnoshare = FALSEwhich always suppresses extended dissimilarities.Nestedness discrepancy index
nesteddiscgained a new argument that allows user to set the number of iterations in optimizing the index.oecosimudisplays the mean of simulations and describes alternative hypothesis more clearly in the printed output.Implemented adjusted R2 for partial RDA. For partial model
rda(Y ~ X1 + Condition(X2))this is the same as the component[a] = X1|X2in variance partition invarpartand describes the marginal (unique) effect of constraining term to adjusted R2.Added Cao dissimilarity (CYd) as a new dissimilarity method in
vegdistfollowing Cao et al., Water Envir Res 69, 95–106 (1997). The index should be good for data with high beta diversity and variable sampling intensity. Thanks to consultation to Yong Cao (Univ Illinois, USA).
vegan 2.0-2
CRAN release: 2011-11-15
Bug Fixes
Function
capscalefailed if constrained component had zero rank. This happened most likely in partial models when the conditions aliased constraints. The problem was observed inanova(..., by ="margin")which uses partial models to analyses the marginal effects, and was reported in an email message to R-News mailing list.stressplotandgoodnesssometimes failed whenmetaMDSwas based onisoMDS(MASS package) becausemetaMDSdistdid not use the same defaults for step-across (extended) dissimilarities asmetaMDS(..., engine = "isoMDS"). The change of defaults can also influence triggering of step-across incapscale(..., metaMDSdist = TRUE).adoniscontained a minor bug resulting from incomplete implementation of a speed-up that did not affect the results. In fixing this bug, a further bug was identified in transposing the hat matrices. This second bug was only active following fixing of the first bug. In fixing both bugs, a speed-up in the internal f.test() function is fully realised. Reported by Nicholas Lewin-Koh.
New Features
ordiarrowsandordisegmentsgained argumentorder.bythat gives a variable to sort points withingroups. Earlier the points were assumed to be in order.Function
ordispiderinvisibly returns the coordinates to which the points were connected. Typically these are class centroids of each point, but for constrained ordination with nogroupsthey are the LC scores.
vegan 2.0-1
CRAN release: 2011-10-20
New Functions
clamtest: new function to classify species as generalists and specialists in two distinct habitats (CLAM test of Chazdon et al., Ecology 92, 1332–1343; 2011). The test is based on multinomial distribution of individuals in two habitat types or sampling units, and it is applicable only to count data with no over-dispersion.as.prestongainedplotandlinesmethods, andas.fishergainedplotmethod (which also can add items to existing plots). These are similar asplotandlinesforprestonfitandfisherfit, but display only data without the fitted lines.raupcrick: new function to implement Raup-Crick dissimilarity as a probability of number of co-occurring species with occurrence probabilities proportional to species frequencies. Vegan has Raup-Crick index as a choice invegdist, but that uses equal sampling probabilities for species and analytic equations. The newraupcrickfunction uses simulation withoecosimu. The function follows Chase et al. (2011) Ecosphere 2:art24 [doi:10.1890/ES10-00117.1], and was developed with the consultation of Brian Inouye.
Bug Fixes
Function
meandistcould scramble items and give wrong results, especially when thegroupingwas numerical. The problem was reported by Dr Miguel Alvarez (Univ. Bonn).metaMDSdid not resettrieswhen a new model was started with aprevious.bestsolution from a different model.Function
permatswapfor community null models using quantitative swap never swapped items in a 2x2 submatrix if all cells were filled.The result from
permutest.ccacould not beupdated because of a ‘NAMESPACE’ issue.R 2.14.0 changed so that it does not accept using
sd()function for matrices (which was the behaviour at least since R 1.0-0), and several vegan functions were changed to adapt to this change (rda,capscale,simulatemethods forrda,ccaandcapscale). The change in R 2.14.0 does not influence the results but you probably wish to upgrade vegan to avoid annoying warnings.
vegan 2.0-0
CRAN release: 2011-09-08
General
Peter Minchin joins the vegan team.
vegan implements standard R ‘NAMESPACE’. In general,
S3methods are not exported which means that you cannot directly use or see contents of functions likecca.default,plot.ccaoranova.ccabyterm. To use these functions you should rely on R delegation and simply useccaand for its result objects useplotandanovawithout suffix.cca. To see the contents of the function you can use:::, such asvegan:::cca.default. This change may break packages, documents or scripts that rely on non-exported names.vegan depends on the permute package. This package provides powerful tools for restricted permutation schemes. All vegan permutation will gradually move to use permute, but currently only
betadisperuses the new feature.
New Functions
monoMDS: a new function for non-metric multidimensional scaling (NMDS). This function replacesMASS::isoMDSas the default method inmetaMDS. Major advantages ofmonoMDSare that it has ‘weak’ (‘primary’) tie treatment which means that it can split tied observed dissimilarities. ‘Weak’ tie treatment improves ordination of heterogeneous data sets, because maximum dissimilarities of1can be split. In addition to global NMDS,monoMDScan perform local and hybrid NMDS and metric MDS. It can also handle missing and zero dissimilarities. Moreover,monoMDSis faster than previous alternatives. The function usesFortrancode written by Peter Minchin.MDSrotatea new function to replacemetaMDSrotate. This function can rotate bothmetaMDSandmonoMDSresults so that the first axis is parallel to an environmental vector.eventstarfinds the minimum of the evenness profile on the Tsallis entropy, and uses this to find the corresponding values of diversity, evenness and numbers equivalent following Mendes et al. (Ecography 31, 450-456; 2008). The code was contributed by Eduardo Ribeira Cunha and Heloisa Beatriz Antoniazi Evangelista and adapted to vegan by Peter Solymos.fitspecaccumfits non-linear regression models to the species accumulation results fromspecaccum. The function can use new self-starting species accumulation models in vegan or other self-starting non-linear regression models in R. The function can fit Arrhenius, Gleason, Gitay, Lomolino (in vegan), asymptotic, Gompertz, Michaelis-Menten, logistic and Weibull (in base R) models. The function hasplotandpredictmethods.Self-starting non-linear species accumulation models
SSarrhenius,SSgleason,SSgitayandSSlomolino. These can be used withfitspecaccumor directly in non-linear regression withnls. These functions were implemented because they were found good for species-area models by Dengler (J. Biogeogr. 36, 728-744; 2009).
New Features
adonis,anosim,meandistandmrppwarn on negative dissimilarities, andbetadisperrefuses to analyse them. All these functions expect dissimilarities, and giving something else (like correlations) probably is a user error.betadisperuses restricted permutation of the permute package.metaMDSusesmonoMDSas its default ordination engine. Function gains new argumentenginethat can be used to alternatively selectMASS::isoMDS. The default is not to usestepacrosswithmonoMDSbecause its ‘weak’ tie treatment can cope with tied maximum dissimilarities of one. However,stepacrossis the default withisoMDSbecause it cannot handle adequately these tied maximum dissimilarities.specaccumgainedpredictmethod which uses either linear or spline interpolation for data between observed points. Extrapolation is possible with spline interpolation, but may make little sense.specpoolcan handle missing values or empty factor levels in the grouping factorpool. Now also checks that the length of thepoolmatches the number of observations.
Deprecated and Defunct
metaMDSrotatewas replaced withMDSrotatethat can also handle the results ofmonoMDS.permuted.index2and other “new” permutation code was removed in favour of the permute package. This code was not intended for normal use, but packages depending on that code in vegan should instead depend on permute.