# Set random seed:
set.seed(17)
# Get first MPT for the Michaux data set:
time_tree <- ape::read.tree(text = paste0("(Ancilla:31.6,(Turrancilla:102.7,",
"(Ancillista:1,Amalda:63.5):1):1);"))
# Set root time for tree:
time_tree$root.time <- 103.7
# Get discrete character rates (includes changes):
out <- test_rates(time_tree, michaux_1989,
seq(time_tree$root.time, 0, length.out = 3),
branch_partitions = list(list(1)), alpha = 0.01
)
# Plot character changes on the tree:
plot_changes_on_tree(
out$inferred_character_changes,
time_tree
)
Run the code above in your browser using DataLab