# Distance Matrix Evaluation

### Description

Function `dist.eval`

provides one test of a distance matrix, and then continues with `distconnected`

(vegan). Function `prepare.bioenv`

converts selected variables to numeric variables and then excludes all categorical variables in preparation of applying `bioenv`

(vegan).

### Usage

1 2 | ```
dist.eval(x, dist)
prepare.bioenv(env, as.numeric = c())
``` |

### Arguments

`x` |
Community data frame with sites as rows, species as columns and species abundance as cell values. |

`env` |
Environmental data frame with sites as rows and variables as columns. |

`dist` |
Method for calculating ecological distance with function |

`as.numeric` |
Vector with names of variables in the environmental data set to be converted to numeric variables. |

### Details

Function `dist.eval`

provides two tests of a distance matrix:

(i) The first test checks whether any pair of sites that share some species have a larger distance than any other pair of sites that do not share any species. In case that cases are found, then a warning message is given.

(ii) The second test is the one implemented by the `distconnected`

function (vegan). The distconnected test is only calculated for distances that calculate a value of 1 if sites share no species (i.e. not manhattan or euclidean), using the threshold of 1 as an indication that the sites do not share any species. Interpretation of analysis of distance matrices that provided these warnings should be cautious.

Function `prepare.bioenv`

provides some simple methods of dealing with categorical variables prior to applying `bioenv`

.

### Value

The function tests whether distance matrices have some desirable properties and provide warnings if this is not the case.

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

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

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
library(vegan)
data(dune)
dist.eval(dune,"euclidean")
dist.eval(dune,"bray")
## Not run:
data(dune.env)
dune.env2 <- dune.env[,c('A1', 'Moisture', 'Manure')]
dune.env2$Moisture <- as.numeric(dune.env2$Moisture)
dune.env2$Manure <- as.numeric(dune.env2$Manure)
sol <- bioenv(dune ~ A1 + Moisture + Manure, dune.env2)
sol
summary(sol)
dune.env3 <- prepare.bioenv(dune.env, as.numeric=c('Moisture', 'Manure'))
bioenv(dune, dune.env3)
## End(Not run)
``` |