distance {ecodist} | R Documentation |
This function calculates a variety of dissimilarity or distance metrics. Although it duplicates the functionality of dist() and bcdist(), it is written entirely in R, and can easily be extended to include additional metrics.
distance(x, method = "euclidean")
x |
matrix or data frame with rows as samples and columns as variables (such as species). Distances will be calculated for each pair of rows. |
method |
Currently 5 dissimilarity metrics can be calculated: euclidean bray-curtis manhattan mahalanobis jaccard Partial matching will work for selecting a method. |
Returns a lower-triangular distance matrix as an object of class "dist".
Sarah Goslee <Sarah.Goslee@ars.usda.gov>
## Not run: data(iris) iris.md <- distance(iris[,1:4], "mahal") ## End(Not run) # A full example is available in the distance # section of the main help file for ecodist.