# NOT RUN {
# generate random tree
Ntips = 1000
tree = generate_random_tree(list(birth_rate_intercept=1),max_tips=Ntips)$tree
# pick random tip subsets
Nsubsets = 100
size = 50
subsets = pick_random_tips(tree, size, Nsubsets, with_replacement=FALSE)
# count the number of times each tip was picked in a subset ("popularity")
popularities = table(subsets)
# plot histogram of tip popularities
hist(popularities,breaks=20,xlab="popularity",ylab="# tips",main="tip popularities")
# }
Run the code above in your browser using DataLab