# Build example ten-tip tree:
time_tree <- ape::read.tree(text = paste0("(A:1,(B:1,((C:1,(D:1,(E:1,F:1):1):1):1,",
"((G:1,H:1):1,(I:1,J:1):1):1):1):1);"))
# Arbitrarily add a root.time value of 100 Ma:
time_tree$root.time <- 100
# Build example tip state values:
tip_states <- c(A = 0, B = 0, C = 1, D = 1, E = 0, F = 1, G = 1, H = 1, I = 0, J = 1)
# Run map_dollo_changes on data and store output:
out <- map_dollo_changes(time_tree, tip_states)
# View matrix of changes:
out$changes
# View stochastic character map (time spent in each state on each branch):
out$stochastic_character_map
Run the code above in your browser using DataLab