# NOT RUN {
# generate random tree (target tree)
Ntips = 10000
tree = castor::generate_random_tree(parameters=list(birth_rate_intercept=1), max_tips=Ntips)$tree
# extract random subtree (reference tree)
Nsubtips = 10
subtips = sample.int(n=Ntips,size=Nsubtips,replace=FALSE)
subtreeing = castor::get_subtree_with_tips(tree, only_tips=subtips)
subtree = subtreeing$subtree
# map subset of target tips to reference tips
mapping = matrix(c(subtreeing$new2old_tip,(1:Nsubtips)),ncol=2,byrow=FALSE)
# extract divergence times by congruification
congruification = congruent_divergence_times(subtree, tree, mapping)
cat("Concordant target nodes:\n")
print(congruification$target_nodes)
cat("Ages of concordant nodes:\n")
print(congruification$ages)
# }
Run the code above in your browser using DataLab