set.seed(5)
#generate random phylogeny
randtree <- rcoal(50)
#simulate trait evolution for a subset of taxa on phylogeny
randtraits <- sample(rTraitCont(randtree, sigma=10, root.value=100), 40)
#estimate trait values for "missing" taxa using PIC method
phyEstimate(randtree, randtraits, method="pic")
#simulate a discrete trait for a subset of taxa on the phylogeny
randdisctraits <- sample(rTraitDisc(randtree, model="ER", k=2), 40)
#estimate discrete trait states for "missing" taxa
phyEstimateDisc(randtree, randdisctraits)
Run the code above in your browser using DataLab