### Install vegan from GitHub using remotes Source: https://github.com/vegandevs/vegan/blob/master/README.md This snippet demonstrates how to install the development version of the vegan R package directly from its GitHub repository using the 'remotes' package. Ensure you have developer tools installed for source installation. ```r install.packages("remotes") remotes::install_github("vegandevs/vegan") ``` -------------------------------- ### Install vegan binaries from R Universe Source: https://github.com/vegandevs/vegan/blob/master/README.md This snippet shows how to install a binary version of the vegan R package from the R Universe repository, similar to installing from CRAN. This method is convenient if you prefer pre-compiled packages and have the necessary repository configured. ```r install.packages('vegan', repos = c('https://vegandevs.r-universe.dev','https://cloud.r-project.org')) ``` -------------------------------- ### Installation Adaptations in vegan 2.6-2 Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Details on how the vegan package's compiled code was adapted for R 4.2.0 and how cross-references were updated for CRAN. ```R Compiled code adapted to R 4.2.0 changes. Cross-references to functions in other packages updated for more stringent CRAN tests. ``` -------------------------------- ### metaMDS Iteration Strategy and Convergence Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The 'metaMDS' function features a new iteration strategy with 'try' (minimum random starts) and 'trymax' (maximum random starts) arguments. If no solutions converge, 'metaMDS' now tabulates stopping criteria when 'trace = TRUE' to aid in parameter adjustment. ```R metaMDS(comm, try = 10, trymax = 100, trace = TRUE) ``` -------------------------------- ### Vegan Package Installation Notes Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Recent updates to the vegan package have adapted dependencies and namespace imports to align with changes in R, aiming to eliminate warnings and notes during package testing. This ensures smoother installation and operation. ```R # No specific code snippet for installation notes, but implies: # install.packages("vegan") # Ensure R is up-to-date for compatibility. ``` -------------------------------- ### Installation without tcltk Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The vegan package can now be installed and loaded without requiring the 'tcltk' package. The 'tcltk' package is only necessary for the 'orditkplot' function, which requires interactive graphical editing capabilities. ```R install.packages("vegan") library(vegan) ``` -------------------------------- ### R: Installation and Dependency Updates Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Specifies that vegan depends on R 3.4.0 or higher, with a potential increase to R 3.6.0 in future releases. Details improvements in R's random index finding for permuting and sampling data, impacting vegan's ecological null models and permutation routines. ```R ## 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`, `permatswap` and 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](https://github.com/vegandevs/vegan/issues/312). Most vegan permutation routines rely on [permute](https://CRAN.R-project.org/package=permute), and there you gain similar benefits of improved randomness when you upgrade **R**. * Thanks to the new **R** dependence, `sigma` for constrained ordination results works without workarounds of vegan 2.5-2. This fixes completely the issue discussed in [#274](https://github.com/vegandevs/vegan/issues/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**. ``` -------------------------------- ### metaMDS tries reset issue Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Fixed an issue where 'metaMDS' did not reset 'tries' when starting a new model with a 'previous.best' solution from a different model. ```R metaMDS(..., previous.best = ...) ``` -------------------------------- ### metaMDS Informative Reporting Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `metaMDS` function provides more informative feedback regarding the discovery of similar results from repeated random starts, using clearer language in its output. ```R metaMDS(data, trymax = 100) ``` -------------------------------- ### R ordistep Scope Interpretation Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `ordistep` function has an improved interpretation of the `scope` argument. If the lower scope is not provided, the formula from the starting solution is now used as the lower scope, replacing the previous behavior of using an empty model. ```R ordistep(object, scope, ...) # Improved scope interpretation: uses starting solution formula if lower scope is missing. ``` -------------------------------- ### Null Model Algorithms: curveball, quasiswap, backtracking Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Upgrades to null model analysis include a new 'curveball' algorithm for binary matrices with fixed row and column sums. The 'quasiswap' algorithm now accepts a 'thin' argument to reduce bias, and the 'backtracking' algorithm is faster, though still slow. Compiled code in null model simulations can now be interrupted. ```R vegan::nullmodel(matrix, method = "curveball") vegan::nullmodel(matrix, method = "quasiswap", thin = 10) vegan::nullmodel(matrix, method = "backtracking") ``` -------------------------------- ### Startup Message Behavior Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The vegan package now prints its startup message (e.g., "This is vegan 2.6-10") only in interactive sessions. The version number will not be displayed in package checks or other scripts, reducing potential clutter. ```R # In interactive session: library(vegan) # Output: "This is vegan 2.6-10" # In non-interactive session (e.g., script): # No startup message will be printed. ``` -------------------------------- ### Scaling and Centering in simulate.rda Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Ensures that the original data are scaled and centered similarly to simulations in 'simulate.rda' when multiple simulations are returned as a 'simmat' object. ```R # Scaling and centering in simulate.rda # library(vegan) # Example usage: # data(dune) # cca_model <- cca(dune ~ ., data=dune) # sims <- simulate(cca_model, nsim=5, "simmat") # # Check if scaling/centering is consistent with nullmodel or oecosimu usage. ``` -------------------------------- ### Accessing Documentation and News Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Provides recommended methods for accessing vegan package documentation and news. Instead of the defunct 'vegandocs' function, users should utilize 'browseVignettes("vegan")' for vignettes and 'news(package="vegan")' for package news. ```R browseVignettes("vegan") news(package = "vegan") ``` -------------------------------- ### Null Model Specification in adipart, hiersimu, multipart Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The functions 'adipart', 'hiersimu', and 'multipart' now expose the 'method' argument to allow users to specify the null model used in their analysis. ```R adipart(comm, method = "random") ``` -------------------------------- ### New Null Model: 'greedyqswap' (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Introduction of the 'greedyqswap' null model for ecological simulations. This model significantly accelerates quasi-swap models with minimal risk of introducing bias, enhancing the performance of functions like nullmodel, simulate, make.commsim, and oecosimu. ```R library(vegan) # Example usage with nullmodel: # data(example_data) # null_model <- nullmodel(example_data, method = "greedyqswap") # simulated_data <- simulate(null_model, nsim = 100) ``` -------------------------------- ### Self-Starting Species Accumulation Models Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Provides self-starting non-linear models for species accumulation curves: `SSarrhenius`, `SSgleason`, `SSgitay`, and `SSlomolino`. These can be used with `fitspecaccum` or directly with R's `nls` function for species-area modeling. ```R SSarrhenius(x, a, b, c) SSgleason(x, a, b, c) SSgitay(x, a, b, c) SSlomolino(x, a, b, c) # Example usage with nls: # nls(formula, data = data, start = list(a = 1, b = 1, c = 1), algorithm = "port") ``` -------------------------------- ### Diversity Partitioning Functions with Formula and Default Methods Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Functions for diversity partitioning (`adipart`, `hiersimu`, `multipart`) now include `formula` and `default` methods. The `formula` method retains previous functionality, while the `default` method accepts two matrices as input. `adipart` and `multipart` can also be used for overall partitioning to alpha, beta, and gamma diversities by omitting the hierarchy argument. ```R adipart(..., formula, default) hiersimu(..., formula, default) multipart(..., formula, default) ``` -------------------------------- ### oecosimu output clarity Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The 'oecosimu' function now provides a clearer description of the mean of simulations and alternative hypotheses in its output. ```R oecosimu(...) ``` -------------------------------- ### Vegan API Documentation Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Documentation for key functions within the Vegan R package, including `cca`, `rda`, `dbrda`, `scores`, `summary.cca`, `anova.cca`, `prc`, `eigenvals`, `capscale`, `stressplot.dbrda`, and `predict.dbrda`. ```APIDOC Function: cca(..., formula, data, subset, na.action, method = "CCA", ...) Description: Performs Canonical Correspondence Analysis. Parameters: - formula: A formula object, like y ~ x1 + x2. - data: Data frame containing the variables. - method: The ordination method (default "CCA"). - ...: Other arguments passed to underlying functions. Returns: An object of class "cca", "rda" or "dbrda". Related: rda, dbrda, anova.cca, scores.cca Function: scores(x, display, choices, scaling, tidy, ...) Description: Extracts scores from ordination objects. Parameters: - x: An ordination object (e.g., from cca, rda). - display: Which scores to display ('sites', 'species', 'bp', 'lc', 'wa', 'lc', 'all'). Defaults to 'all'. - choices: Which axes to display. - tidy: If TRUE, returns a data frame. - ...: Additional arguments, including 'droplist' for single score type output. Returns: A matrix or list of matrices containing the scores. Related: cca, rda, dbrda, summary.cca Function: summary(object, ...) Description: Summarizes ordination results. Parameters: - object: An ordination object. - ...: Additional arguments. Returns: A summary object, often printed to console. Note: Ordination scores are no longer printed by default. Related: scores, cca, rda, dbrda Function: anova(object, ...) Description: Performs permutation tests for ordination models. Parameters: - object: An ordination object. - by: Test significance by 'terms', 'axis', 'margin', 'onedf'. - cutoff: Threshold for stopping permutations (used with 'axis'). - ...: Additional arguments. Related: cca, rda, dbrda Function: prc(..., formula, data, ...) Description: Fits Principal Response Curve models. Parameters: - formula: A formula object. - data: Data frame. - ...: Additional arguments. Returns: An object of class 'prc'. Note: Coefficient scaling updated. Related: summary.prc Function: eigenvals(x, ...) Description: Extracts eigenvalues from ordination objects. Parameters: - x: An ordination object. - ...: Additional arguments. Returns: A vector of eigenvalues. Note: Summary handles negative eigenvalues. Related: summary.eigenvals, cca, rda, dbrda Function: capscale(..., formula, data, ...) Description: Performs Principal Coordinates Analysis using various distance measures. Parameters: - formula: A formula object. - data: Data frame. - ...: Additional arguments. Returns: An object of class 'capscale'. Note: Output proportions are for real components only; RsquareAdj ignores imaginary components. Related: cca, rda, dbrda, summary.capscale Function: stressplot(x, ...) Description: Creates a stress plot for ordination results. Parameters: - x: An ordination object. - ...: Additional arguments. Note: Refuses to handle partial models for dbrda. Related: dbrda Function: predict(object, ...) Description: Predicts values or scores from ordination objects. Parameters: - object: An ordination object. - type: Type of prediction ('wa', 'lc', 'working'). - ...: Additional arguments. Note: For dbrda, returns 'working' scores by default. Related: dbrda, cca, rda ``` -------------------------------- ### decorana: C Implementation for Speed and Memory (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md A significant portion of the R code for the `decorana` function has been rewritten in C. This optimization results in faster execution and reduced memory consumption. ```R library(vegan) # Example usage: # data(example_data) # decorana_result <- decorana(example_data) # plot(decorana_result) ``` -------------------------------- ### Defunct: commsimulator Function (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `commsimulator` function is now defunct. Users should use the `simulate` function with `nullmodel` objects instead. ```R # Defunct function: commsimulator() # Use simulate(nullmodel_object) instead. ``` -------------------------------- ### Null Model Generation with nullmodel and oecosimu Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The null model generation framework in vegan has been rewritten, featuring the `nullmodel` function for construction and `commsim` for definition. The `simulate` function generates null models, supporting various quantitative and binary models. `oecosimu` is the primary tool for analyzing these null models, offering an alternative to permutation tests. ```R ## Core functions for null models: nullmodel(): Constructs null models commsim(): Defines null model properties simulate(): Generates null model arrays oecosimu(): Invokes and analyzes null models ## Capabilities: # Supports quantitative and binary null models # Allows user-defined generating functions # Can analyze any statistic, not just nestedness ``` -------------------------------- ### Efficient Swap-Based Binary Null Models (C) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Optimized C implementation for swap-based binary null models. The update reduces the generation of random numbers by skipping unnecessary calculations for 2x2 submatrices, leading to significant speedups. Note that this change alters random number sequences, affecting reproducibility with older versions. ```C /* Original logic: Generate four random numbers for a 2x2 submatrix. */ /* Optimized logic: Skip generating the third and fourth random numbers if the matrix cannot be swapped. */ // Example of optimization (conceptual): // if (can_swap(matrix)) { // generate_random_numbers(); // } else { // // Skip random number generation for impossible swaps // } ``` -------------------------------- ### oecosimu Test Direction Clarity Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The setting of test direction in oecosimu is now clearer. ```R oecosimu <- function(..., alternative) { # Clearer setting of test direction } ``` -------------------------------- ### C and Fortran Routines Registration in Vegan Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Vegan now registers its native C and Fortran routines. This practice helps avoid warnings during model checking and may offer a slight performance improvement. ```C // Example of C routine registration (conceptual) // R_registerRoutines(DllInfo, NULL, CallEntries, NULL, NULL); ``` ```Fortran ! Example of Fortran routine registration (conceptual) ! SUBROUTINE R_init_vegan(dll) ! ... ! END SUBROUTINE ``` -------------------------------- ### Backtracking Null Models (C) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Backtracking null models are now implemented in C for improved performance. While faster, these models are noted to be biased and are provided primarily for legacy compatibility. ```C /* C implementation for backtracking null models. Note: These models are biased but faster due to C implementation. */ ``` -------------------------------- ### New BCI.env Dataset Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Adds the 'BCI.env' dataset, containing site information for the Barro Colorado Island tree community data. This dataset is primarily useful for its UTM coordinates. ```R * New data set `BCI.env` of 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. ``` -------------------------------- ### Configurable Msoplot Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `msoplot` function is now more configurable, allowing users to set y-axis limits and other parameters. ```R msoplot(..., ylim = c(min, max)) ``` -------------------------------- ### Capscale Output and RsquareAdj Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The printed output of `capscale` now shows proportions for real components only, ignoring imaginary dimensions, consistent with other support methods. `RsquareAdj` for `capscale` is also based solely on positive eigenvalues. ```R library(vegan) # Example: Fitting a capscale model # capscale_model <- capscale(response ~ predictor, data = mydata) # The printed summary will reflect proportions of real components only # print(capscale_model) # RsquareAdj calculation will ignore imaginary components # RsquareAdj(capscale_model) ``` -------------------------------- ### varpart: Data Frame Factors for Model Matrices (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Explanatory tables in `varpart` can now be data frames containing factors or single factors, which are automatically expanded into model matrices. This improves flexibility for specifying model terms. ```R library(vegan) # Example usage: # data(example_data) # explanatory_df <- data.frame(factor1 = factor(rep(c('A', 'B'), length.out = nrow(example_data)))) # var_part <- varpart(example_data, ~ factor1, data = explanatory_df) ``` -------------------------------- ### decostand Parameters and decobackstand Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `decostand` function now returns an attribute `parameters` containing settings and variables used in standardization. The new `decobackstand` function uses these parameters to reconstruct the original non-standardized data. Back-transformation is approximate due to round-off errors and is not available for methods `pa`, `rank`, `rrank`, or `alr`. ```R standardized_data <- decostand(data, method = "normalize") parameters <- attr(standardized_data, "parameters") original_data <- decobackstand(standardized_data, parameters) ``` -------------------------------- ### R inertcomp and summary.cca Handling Zero Rank Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `inertcomp` function and `summary.cca` now correctly handle cases where a constrained component is defined but explains nothing and has zero rank. This prevents errors that occurred in previous versions under such conditions. ```R inertcomp(object, ...) summary(cca(..., Condition(X))) # Handles zero-rank constrained components correctly. ``` -------------------------------- ### permustats Summary and qqmath Enhancements Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The 'summary' method for 'permustats' now displays P-values and allows changing the test direction ('alternative'). The 'qqmath' function for 'permustats' can plot standardized statistics. ```R summary(perm_result, alternative = "greater") qqmath(perm_result, standardized = TRUE) ``` -------------------------------- ### renyiaccum, specaccum, tsallisaccum Subset Argument Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md These functions now include a 'subset' argument for more flexible data selection. ```R renyiaccum <- function(..., subset) {} specaccum <- function(..., subset) {} tsallisaccum <- function(..., subset) {} ``` -------------------------------- ### New Ordination Wrappers: pca(), ca(), pco() Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Introduces new wrapper functions for unconstrained ordination methods: PCA, CA, and PCO. These functions utilize the underlying rda(), cca(), and dbrda() methods respectively. This change aims to simplify the usage of these ordination techniques. ```R pca(data, ...) ca(data, ...) pco(data, ...) ``` -------------------------------- ### avgdist as.dist Arguments Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `avgdist` function now exposes `as.dist` arguments, allowing it to return distance objects (`"dist"`) that display as lower triangles rather than symmetric matrices. ```R avgdist(data, method = "bray", as.dist = TRUE) ``` -------------------------------- ### Bug Fixes in Betadisper Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Corrected an issue where `betadisper()` failed when the `groups` argument was a factor with empty levels. ```R betadisper(..., groups = factor_with_levels) ``` -------------------------------- ### varpart: Partition Chi-squared Inertia (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `varpart` function now supports partitioning Chi-squared inertia for correspondence analysis using the new `chisquare` argument. Adjusted R-squared is based on permutation tests. ```R library(vegan) # Example usage: # data(example_data) # ca_result <- cca(example_data) # var_part <- varpart(example_data, ~ factor1 + factor2, chisquare = TRUE) ``` -------------------------------- ### Residuals and Model Frame for Ordination Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Enhancements to ordiresids for displaying standardized and studentized residuals, and improvements to model.frame and model.matrix construction for constrained ordination. ```R ordiresids(object, ...) model.frame.cca(object, ...) model.matrix.cca(object, ...) ``` -------------------------------- ### Spantree to hclust Conversion Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `spantree` function now includes a support function `as.hclust` to convert a minimum spanning tree into an `hclust` object. ```R as.hclust(spantree_object) ``` -------------------------------- ### Radfit Consistent Access Methods Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Radfit results can now be accessed consistently using methods like AIC, coef, deviance, logLik, fitted, predict, and residuals, regardless of the model structure. ```R ## Radfit consistent access methods # AIC(radfit_result) # coef(radfit_result) # deviance(radfit_result) # logLik(radfit_result) # fitted(radfit_result) # predict(radfit_result) # residuals(radfit_result) ``` -------------------------------- ### Matrix Completion (optspace) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The optspace function is a new addition for matrix completion, used internally for robust Aitchison distance calculations. It helps in filling missing elements within a matrix. ```R optspace(matrix, ...) # Example usage within robust Aitchison distance calculation. ``` -------------------------------- ### R gdispweight Matrix Input Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Enhances 'gdispweight' to accept input data in a matrix format, in addition to data frames. ```R # gdispweight now accepts matrix input # Example: gdispweight(data_matrix) ``` -------------------------------- ### Radfit Predict Method Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The radfit function now includes a predict method that accepts 'newdata' and 'total' arguments for predicting new ranks and site totals. It also supports interpolation to non-integer ranks and extrapolation in some models. ```R ## Radfit predict method # predict(object, newdata, total, ...) # Assuming 'radfit_result' is a result from radfit() # predict(radfit_result, newdata = new_ranks, total = new_totals) ``` -------------------------------- ### New function raupcrick for Raup-Crick dissimilarity Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Implemented 'raupcrick', a new function for Raup-Crick dissimilarity using simulation, suitable for occurrence probabilities proportional to species frequencies. ```R raupcrick(...) ``` -------------------------------- ### Bug Fix: linestack with labels Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Resolved an issue where 'linestack' failed when 'labels' were provided, but the input scores lacked names. ```R linestack(scores, labels = c("A", "B")) ``` -------------------------------- ### MDS Convergence Information Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Setting `trace = 2` in `metaMDS` will now display convergence information when using the default `monoMDS` engine. ```R metaMDS(data, trace = 2) ``` -------------------------------- ### Performance Improvements and Data Handling Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Highlights significant speed improvements in `vegdist`, making it comparable to `stats::dist`. Enhances the robustness of the `data=` argument in the formula interface and improves user error messages, addressing issues reported in GitHub issue #200. Updates taxonomic classifications in `dune.taxon` to APG IV standards. ```R * `vegdist` is much faster. It used to be clearly slower than `stats::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"](https://github.com/vegandevs/vegan/issues/200). * The families and orders in `dune.taxon` were 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). ``` -------------------------------- ### Ordination Output Changes Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The output format for ordination methods (pca, pco, ca, rda, cca, capscale, dbrda) has been updated to better distinguish between results and user notifications. This change improves clarity regarding data or model issues encountered during analysis. ```R # Example of how ordination output might be structured differently # (Conceptual - actual output structure not provided in text) ordination_result <- cca(dune, dune.env) print(ordination_result$results) print(ordination_result$notifications) ``` -------------------------------- ### R treedist and treedive Tree Handling Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Updates 'treedist' and 'treedive' to refuse trees with reversals. 'treeheight' estimates total height with absolute branch lengths, and 'treedive' now handles negative branch heights and is faster. ```R # treedist and treedive improvements for tree handling # Example: treedist(tree_data) # Example: treedive(tree_data) # Example: treeheight(tree_data) ``` -------------------------------- ### Robustness in Constrained Ordination Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Improved robustness for several constrained ordination methods and their support functions in border cases, such as aliased effects, saturated models, and requests for non-existent scores. This includes `capscale`, `ordistep`, `varpart`, the `plot` function for constrained ordination, and `anova(, by = "margin")`. ```R capscale(...) ordistep(...) varpart(...) plot(cca_object, ...) anova(cca_object, by = "margin") ``` -------------------------------- ### R Compatibility Notes Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Details R version dependencies and potential conflicts with other packages like klaR and phyloseq. ```R # Vegan declares dependence on R version 3.2.0. # sigma.cca requires explicit spelling in R-3.2.x. # Potential clash with klaR's rda function. # phyloseq compatibility issues with vegdist, requires re-installing from source or downgrading vegan. ``` -------------------------------- ### New Features in Ordination and Plotting Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Introduces new features including consistent biplot score scaling in `cca`, `rda`, `capscale`, and `dbrda`. Enhancements to `tabasco` allow scaling colours by rows or columns, custom label arguments (`labRow`), and improved handling of zero observations. Sequential and non-sequential null models generated by `nullmodel` and used in `oecosimu` are faster. ```R ## New Features * Biplot scores are scaled similarly as site scores in constrained ordination methods `cca`, `rda`, `capscale` and `dbrda`. Earlier they were unscaled (or more technically, had equal scaling on all axes). * `tabasco` adds argument to `scale` the colours by rows or columns in addition to the old equal scale over the whole plot. New arguments `labRow` and `labCex` can 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 `nullmodel` and also used in `oecosimu`. ``` -------------------------------- ### capscale failure with zero-rank constrained component Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Fixed a bug in 'capscale' where it failed if the constrained component had zero rank, often occurring in partial models with aliased constraints. ```R capscale(...) ``` -------------------------------- ### Weighted Analysis and Lines Method in fitspecaccum Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `fitspecaccum` function now supports weighted analysis and includes a `lines` method for adding lines to plots. ```R fitspecaccum(..., weight = TRUE) lines(fitspecaccum_object) ``` -------------------------------- ### R specpool Extrapolated Richness Handling Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Improves handling in 'specpool' for cases where extrapolated richness indices require doubleton counts, specifically when only one sampling unit is supplied. It now reports observed richness smoothly instead of failing. ```R # Improved handling in specpool for single sampling unit cases # Example: specpool(community_data) ``` -------------------------------- ### Fitting Species Accumulation Models with fitspecaccum Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `fitspecaccum` function fits non-linear regression models to species accumulation curves generated by `specaccum`. It supports various self-starting models from vegan (Arrhenius, Gleason, Gitay, Lomolino) and base R (asymptotic, Gompertz, Michaelis-Menten, logistic, Weibull). It includes `plot` and `predict` methods. ```R fitspecaccum(specaccum_object, model = "SSarrhenius") # Example usage: # sa_model <- fitspecaccum(specaccum_result) # plot(sa_model) ``` -------------------------------- ### Deprecated Functions and Usage Guidance Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Several functions are deprecated. `strata` in permutations should be replaced with `how` from the permute package. `cca`, `rda`, and `capscale` no longer return scaled scores directly; use the `scores` function. `commsimulator` is replaced by `simulate(nullmodel(x, method))`. `density` and `densityplot` for permutation results should use `permustats`. ```APIDOC DEPRECATED: strata(..., permute = TRUE) -> Use how() from permute package cca(..., scale = TRUE), rda(..., scale = TRUE), capscale(..., scale = TRUE) -> Use scores() function to extract scaled results scores(cca_result, display = "species", scaling = 2) commsimulator(x, method) -> Replace with simulate(nullmodel(x, method)) simulate(nullmodel(my_data, "cca")) density(perm_result), densityplot(perm_result) -> Use permustats() method perm_stats <- permustats(perm_result) density(perm_stats) densityplot(perm_stats) ``` -------------------------------- ### ordisurf GAM Flexibility Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The ordisurf function has gained new arguments for more flexible definition of fitted models using mgcv::gam. ```R ordisurf <- function(..., method = 'gam', gam.control = list()) { # New arguments for flexible GAM model definition # Contours linewidth can be set with lwd } ``` -------------------------------- ### Fisher-alpha Estimation Update Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The Kempton and Taylor algorithm in fisherfit and fisher.alpha has been replaced with a simpler estimation based on species and individual counts. Standard errors and profile confidence intervals are no longer provided. ```R fisher.alpha <- function(...) { # Estimation based on species and individual counts only # Removed standard errors and profile confidence intervals } ``` ```R fisherfit <- function(...) { # Estimation based on species and individual counts only # Removed standard errors and profile confidence intervals } ``` -------------------------------- ### R NAMESPACE and S3 Methods in vegan Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md vegan implements standard R NAMESPACE conventions. S3 methods like `cca.default` are not exported directly. Users should rely on R's delegation by calling generic functions (e.g., `cca`, `plot`, `anova`) without the method suffix. Internal function access can be achieved using `:::`, e.g., `vegan:::cca.default`. ```R # Correct usage: # result <- cca(formula, data) # plot(result) # Accessing internal methods (use with caution): # vegan:::cca.default ``` -------------------------------- ### Constrained Ordination Enhancements Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Details improvements in constrained ordination, including renaming inertia in cca, automatic expansion of data frames in rda/cca, extraction of regression scores, and enhanced permutation tests. ```R cca(..., model = "scaled-inertia") rda(..., data, ...) anova.cca(..., model = "full") permutest.cca(..., by = "onedf") ``` -------------------------------- ### R Package Building Dependency Change Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Explains the removal of the 'texi2dvi' dependency for building vignettes in the vegan R package, with 'FAQ-vegan' now using 'knitr'. This change necessitates R version 3.0.0 or later. ```R # Building vignettes no longer requires texi2dvi. # FAQ-vegan now uses knitr. # Requires R >= 3.0.0 ``` -------------------------------- ### Similarity Percentages (Simper) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `simper` function implements Clarke's (1993) "similarity percentages" method. It compares groups and decomposes the average between-group Bray-Curtis dissimilarity index by species contributions. Developed by Eduard Szöcs. ```R simper(data, group, ...) ``` -------------------------------- ### Binding Null Models: smbind function Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The 'smbind' function allows binding null models together by row, column, or replication. It supports treating sequential models as parallel chains for subsequent analysis, such as with 'as.mcmc'. ```R bound_models <- smbind(model1, model2, model3, along = "row") ``` -------------------------------- ### Inertia Components and Contributions Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Updates to inertcomp include the 'unity' argument for calculating local and species contributions to beta-diversity (LCBD and SCBD). goodness is disabled for capscale. ```R inertcomp(..., unity = TRUE) goodness(object, ...) ``` -------------------------------- ### Vegan 2.5-1 General Updates Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Highlights major changes in Vegan 2.5-1, including extensive code changes, increased use of compiled code for performance, and rewritten constrained ordination functions. ```R # Major release with significant changes across the package. # Increased use of compiled code (.Call interface) for smaller memory footprint and speed. # Constrained ordination functions (cca, rda, dbrda, capscale) rewritten for consistency and robustness. # Internal structure of constrained ordination objects changed; use update() for old objects. # Unified and cleaned informative messages (warnings, notes, errors). ``` -------------------------------- ### envfit Failure Fixes Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Addresses two issues with the envfit function: 1) It previously failed when ordination scores were provided as a plain matrix instead of a full ordination result object. 2) It could fail with only one environmental variable if not using the formula interface. Both issues are now resolved. ```R # Fix 1: Using a full ordination result object fit <- envfit(cca_result, env_data) # Fix 2: Using formula interface or multiple variables fit <- envfit(cca_result, env_data ~ var1 + var2) fit <- envfit(cca_result, env_data ~ var1) ``` -------------------------------- ### as.preston and as.fisher plot methods Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Added 'plot' and 'lines' methods for 'as.preston' and a 'plot' method for 'as.fisher' to display data without fitted lines. ```R plot(as.preston(...)) ``` ```R lines(as.preston(...)) ``` ```R plot(as.fisher(...)) ``` -------------------------------- ### Configurable betadisper Plot Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The 'plot' method for 'betadisper' objects is now more configurable, addressing issues related to plot customization. ```R plot(betadisp_result, main = "Beta Dispersion Plot") ``` -------------------------------- ### R fitspecaccum Support Functions Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `fitspecaccum` function now includes new support functions `nobs` and `logLik`. These additions enhance its compatibility with other R packages and functions, facilitating better data integration and analysis. ```R fitspecaccum(..., method = "randomize") nobs(object) logLik(object) # New support functions for better integration with other R functions. ``` -------------------------------- ### decorana Eigenvalue and Tolerance Methods Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `decorana` function now estimates orthogonalized eigenvalues and total inertia (scaled Chi-square), enabling the implementation of `eigenvals`, `bstick`, and `screeplot` methods. Axis lengths are reported for all `decorana` methods. The `tolerance` method has also been implemented to inspect the success of DCA rescaling. ```R decorana_result <- decorana(data) eigenvals(decorana_result) screeplot(decorana_result) tolerance(decorana_result) ``` -------------------------------- ### designdist: Faster Minimum Term Evaluation (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `designdist` function evaluates minimum terms using compiled code, making it faster than `vegdist` for dissimilarities involving minimum terms. However, it may be less numerically stable with large datasets. ```R library(vegan) # Example usage: # data(example_data) # # Assuming a custom dissimilarity formula using minimum terms # custom_dist <- designdist(example_data, method = 'min(A, B)') ``` -------------------------------- ### Fortran Code Modernization for R Compatibility Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Details the modernization of Fortran code within the vegan package to prevent warnings in the latest R versions. This update aims to maintain functional integrity while ensuring compatibility with newer R environments. Users are encouraged to report any suspected issues. ```R ## 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](https://github.com/vegandevs/vegan/issues/). ``` -------------------------------- ### Permutation Data Extraction for Ordination Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Enables extraction of permutation data from the 'anova' results of constrained ordination (cca, rda, capscale) for further analysis using the 'permustats' function. ```R * The permutation data can be extracted from `anova` results of constrained ordination (`cca`, `rda`, `capscale`) and further analysed with `permustats` function. ``` -------------------------------- ### Sequential Test foradonis2 and anova Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `adonis2` and `anova` functions for constrained ordination results now support sequential testing of one-degree-of-freedom effects by splitting multi-level factors into their contrasts. Previously, this functionality was only available in `permutest`. ```R adonis2(formula, method = "canopy", by = "each") anova(ordination_object, by = "terms") ``` -------------------------------- ### Dispersion Weighting Functions Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Implements dispersion weighting methods for ecological data. `dispweight` follows Clarke et al. (2006) and `gdispweight` provides a generalized approach. Both downweight species with significant over-dispersion. ```R dispweight(..., method = "dispersion") gdispweight(..., method = "generalized_dispersion") ``` -------------------------------- ### metaMDS: New 'points' and 'text' Methods (R) Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The `metaMDS` function's results now support new `points` and `text` methods for enhanced plotting customization. ```R library(vegan) # Example usage: # data(example_data) # mds_result <- metaMDS(example_data) # plot(mds_result) # points(mds_result, 'text', col = 'red') ``` -------------------------------- ### Simulation Functions for CCA and RDA Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Simulation functions for `cca` and `rda` can now return multiple simulations in a `nullmodel`-compatible object. They also support correlated errors in parametric simulations with Gaussian error, including for `capscale`. ```R simulate(cca_model, nsim = 100, correlated_errors = TRUE) simulate(rda_model, nsim = 100, correlated_errors = TRUE) simulate(capscale_model, nsim = 100, correlated_errors = TRUE) ``` -------------------------------- ### Adaptation to R 2.14.0 sd() function change Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md Several vegan functions ('rda', 'capscale', 'simulate' methods) were updated to adapt to R 2.14.0's change in not accepting sd() for matrices. ```R rda(...) ``` ```R capscale(...) ``` ```R simulate(..., "rda") ``` ```R simulate(..., "cca") ``` ```R simulate(..., "capscale") ``` -------------------------------- ### Permutation Schemes with permute Package Source: https://github.com/vegandevs/vegan/blob/master/NEWS.md The vegan package now depends on the `permute` package for advanced permutation schemes. Functions like `betadisper` utilize this package for restricted permutations, enhancing the flexibility and power of statistical analyses. ```R library(permute) # Example usage within vegan functions: # betadisper(vegdist(data), group, permutations = how(within = Within(type = "free"))) ```