# Example of multivariate analysis using built-in iris dataset
data(iris)
iris.md <- distance(iris[,1:4], "mahal")
# Create a model matrix for testing species differences
iris.model <- distance(as.numeric(iris[,5]), "eucl")
iris.model[iris.model > 0] <- 1
# Test whether samples within the same species are more similar than those not
mantel(iris.md ~ iris.model)
# A full example is available in the Mantel test
# section of the main help file for \link{ecodist}.
Run the code above in your browser using DataLab