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

Description Usage Arguments Details Value Author(s) References Examples

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

1
2
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" or "chao". 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

1
2
3
4
5
6
7
8
library(vegan)
library(mgcv)
data(dune)
distmatrix <- vegdist(dune,method="kulc")
ordination.model1 <- cmdscale(distmatrix,k=2)
ordiplot1 <- ordiplot(ordination.model1)
distdisplayed(dune,ordiplot=ordiplot1,distx="kulc",plotit=TRUE,
    method="spearman",permutations=100,gam=TRUE)

Example output

Loading required package: tcltk
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
BiodiversityR 2.11-1: Use command BiodiversityRGUI() to launch the Graphical User Interface; 
to see changes use BiodiversityRGUI(changeLog=TRUE, backward.compatibility.messages=TRUE)

Warning message:
no DISPLAY variable so Tk is not available 
Loading required package: nlme
This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.
species scores not available
$gamanalysis

Family: gaussian 
Link function: identity 

Formula:
dist2 ~ s(dist1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 0.487297   0.006694    72.8   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Approximate significance of smooth terms:
           edf Ref.df     F p-value    
s(dist1) 1.732  2.176 482.3  <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

R-sq.(adj) =  0.847   Deviance explained = 84.9%
GCV = 0.0086368  Scale est. = 0.0085126  n = 190

$mantelanalysis

Mantel statistic based on Spearman's rank correlation rho 

Call:
mantel(xdis = dist1, ydis = dist2, method = method, permutations = permutations) 

Mantel statistic r: 0.9232 
      Significance: 0.009901 

Upper quantiles of permutations (null model):
  90%   95% 97.5%   99% 
0.113 0.165 0.193 0.203 
Permutation: free
Number of permutations: 100

BiodiversityR documentation built on April 20, 2021, 5:07 p.m.