# Create a random 10-taxon tree:
time_tree <- ape::rtree(n = 10)
# Add root age:
time_tree$root.time <- max(diag(ape::vcv(time_tree)))
# Create time bins:
time_bins <- matrix(data = c(seq(from = time_tree$root.time, to = 0,
length.out = 11)[1:10], seq(from = time_tree$root.time, to = 0,
length.out = 11)[2:11]), ncol = 2, dimnames = list(LETTERS[1:10],
c("fad", "lad")))
# Set class:
class(time_bins) <- "timeBins"
# Get edge lengths for each bin:
bin_edge_lengths(time_tree = time_tree, time_bins = time_bins)
Run the code above in your browser using DataLab