data(ips.tree)
## Simulate varying number of intraspecific observations
s <- sapply(1:Ntip(ips.tree), sample, x = 1:3, size = 1)
x <- rep(ips.tree$tip.label, times = s)
x <- data.frame(old_tips = x,
new_tips = paste0(x, unlist(lapply(s, function(z) 1:z))))
## Create polytomies, generate tip labels automatically
tre1 <- combMyTree(ips.tree, x, brlen = 0, unit = "absolute")
plot(tre1, no.margin = TRUE, cex =.5)
## Create polytomies, take tip labels from data frame
tre2 <- combMyTree(ips.tree, x, tips = "new_tips", brlen = 0, unit = "absolute")
plot(tre2, no.margin = TRUE, cex =.5)
Run the code above in your browser using DataLab