
Last chance! 50% off unlimited learning
Sale ends in
Trims a morphological distance matrix by removing objects that cause empty cells.
TrimMorphDistMatrix(dist.matrix, Tree = NULL)
A distance matrix in the format created by MorphDistMatrix.
If the distance matrix includes ancestors this should be the tree (phylo object) used to reconstruct them.
A complete distance matrix with all cells filled. If there were no empty cells will return original.
A tree (if supplied) with the removed taxa (see below) pruned. If no taxa are dropped will return the same tree as inputted. If no tree is supplied this is set to NULL.
A character vector listing the taxa removed. If none are removed this will be set to NULL.
Trims a morphological distance matrix by removing nodes (terminal or internal) that cause empty cells allowing it to be passed to an ordination function such as cmdscale.
Some distances are not calculable from cladistic matrices if there are taxa that have no coded characters in common. This algorithm iteratively removes the taxa responsible for the most empty cells until the matrix is complete (no empty cells).
If the matrix includes reconstructed ancestors the user should also provide the tree used (as the tree
argument). The function will then also remove the tips from the tree and where reconstructed ancestors also cause empty cells will prune the minimum number of descendants of that node. The function will then renumber the nodes in the distance matrix so they match the pruned tree.
# NOT RUN {
# Get morphological distances for Michaux (1989) data set:
distances <- MorphDistMatrix(Michaux1989)
# Attempt to trim max.dist.matrix:
TrimMorphDistMatrix(distances$DistanceMatrix)
# }
Run the code above in your browser using DataLab