# Set random seed:
set.seed(4)
# Generate a random tree for the Day data set:
time_tree <- ape::rtree(n = nrow(day_2016$matrix_1$matrix))
# Update taxon names to match those in the data matrix:
time_tree$tip.label <- rownames(x = day_2016$matrix_1$matrix)
# Set root time by making youngest taxon extant:
time_tree$root.time <- max(diag(x = ape::vcv(phy = time_tree)))
# Use Day matrix as cladistic matrix:
cladistic_matrix <- day_2016
# Prune most characters out to make example run fast:
cladistic_matrix <- prune_cladistic_matrix(cladistic_matrix,
characters2prune = c(2:3, 5:37)
)
# Estimate ancestral states:
estimate_ancestral_states(
cladistic_matrix = cladistic_matrix,
time_tree = time_tree
)
Run the code above in your browser using DataLab