distdisplayed: Compare Distance Displayed in Ordination Diagram with...

distdisplayedR Documentation

Compare Distance Displayed in Ordination Diagram with Distances of Distance Matrix

Description

This function compares the distance among sites as displayed in an ordination diagram (generated by ordiplot) with the actual distances among sites as available from a distance matrix (as generated by vegdist).

Usage

distdisplayed(x, ordiplot, distx = "bray", plotit = T, addit = F, 
    method = "spearman", permutations = 100, abline = F, gam = T, ...) 

Arguments

x

Community data frame (with sites as rows, species as columns and species abundance as cell values) or distance matrix.

ordiplot

Ordination diagram generated by ordiplot or distance matrix.

distx

Ecological distance used to calculated the distance matrix (theoretically the same distance as displayed in the ordination diagram); passed to vegdist and partial match to "manhattan", "euclidean", "canberra", "bray", "kulczynski", "jaccard", "gower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "aitchison" or "robust.aitchison". This argument is ignored in case that "x" is already a distance matrix.

plotit

Should a plot comparing the distance in ordination diagram (or the distance matrix) with the distance from the distance matrix be generated (or not).

addit

Should the GAM regression result be added to an existing plot (or not).

method

Method for calculating the correlation between the ordination distance and the complete distance; from function mantel passed to function cor: "pearson", "spearman" or "kendall".

permutations

Number of permutations to assess the significance of the Mantel test; passed to mantel.

abline

Should a reference line (y=x) be added to the graph (or not).

gam

Evaluate the correspondence between the original distance and the distance from the ordination diagram with GAMas estimated by gam.

...

Other arguments passed to mantel.

Details

This function compares the Euclidean distances (between sites) displayed in an ordination diagram with the distances of a distance matrix. Alternatively, the distances of one distance matrix are compared against the distances of another distance matrix.

These distances are compared by a Mantel test (mantel) and (optionally) a GAM regression (gam). Optionally, a graph is provided compairing the distances and adding GAM results. .

Value

The function returns the results of a Mantel test and (optionally) the results of a GAM analysis.

Author(s)

Roeland Kindt (World Agroforestry Centre)

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

https://www.worldagroforestry.org/output/tree-diversity-analysis

Examples

library(vegan)
library(mgcv)
data(dune)
# pseudocount used by aitchison distance
distmatrix <- vegdist(dune, method="kulc", pseudocount=1)
ordination.model1 <- cmdscale(distmatrix,k=2)
ordiplot1 <- ordiplot(ordination.model1)
distdisplayed(dune, ordiplot=ordiplot1, distx="kulc", plotit=TRUE,
    method="spearman", permutations=100, gam=TRUE)

BiodiversityR documentation built on Jan. 6, 2023, 5:18 p.m.