## Loading morphological data and a tree
data(BeckLee_mat50)
data(BeckLee_tree)
## The average squared pairwise distance metric (used in geiger::dtt)
average.sq <- function(X) mean(pairwise.dist(X)^2)
## Calculate the disparity of the dataset using dtt.dispRity
dispRity_dtt <- dtt.dispRity(data = BeckLee_mat50, metric = average.sq,
tree = BeckLee_tree, nsim = 20)
## Plotting the results
plot(dispRity_dtt)
Run the code above in your browser using DataLab