
requiprobable(n, labels, label.counts = rep(1, length(labels)))
length(labels)
. The number of tips using each label.n=1
, a tree of class “phylo”. Otherwise, multiple trees in a list of class “multiPhylo”.
label.counts
, where every value is 1.
To sample from unlabeled trees use a labels
of length 1 and set label.counts
as a single integer equal to the number of tips in the tree.
To sample semilabeled trees label.counts
should be the number of tips of the tree for each tip label from labels
.
G. Furnas, The generation of random, binary unordered trees, J. Classif. 1 (1984) 187-233.
For unlabeled trees:
L. Cavalli-Sforza, A. Edwards, Phylogenetic analysis: Models and esti- mation procedures, Am. J. Hum. Genet. 19 (1967) 233-257.
For semi-labeled trees:
N. Hallinan. Null models for gene family trees, Math. Biosci. (In review).
plot.phylo
, recon.score
##We are going to sample 10 labeled 10 unlabeled and 10 semi labeled 10 tip trees
labeled<-requiprobable(10,c("A1","A2","B1","B2","B3","C1","C2","C3","C4","C5"))
plot(labeled)
unlabeled<-requiprobable(10,"?",10)
plot(unlabeled)
##If you want to add tip labels to these trees
for (i in 1:10) unlabeled[[i]]$tip.label<-sample(c("A1","A2","B1","B2","B3","C1","C2","C3","C4","C5"))
semilabeled<-requiprobable(10,c("A","B","C"),c(2,3,5))
plot(semilabeled)
Run the code above in your browser using DataLab