Re: [R-sig-phylo] ace in ape how to derive ancestral states (which.max)

2013-03-21 Thread Liam J. Revell
One final comment on this. Since the conditional scaled likelihoods of the subtree and the marginal ancestral state reconstruction are equivalent at the root node of the tree, a computationally simple (but slow) method for getting the marginal ancestral state reconstructions is to move the

Re: [R-sig-phylo] ace in ape how to derive ancestral states (which.max)

2013-03-20 Thread Liam J. Revell
Hi Andres. To answer your question at its face value, the line of code you want is: anc-setNames(apply(ANC$lik.anc,1,function(x) names(which.max(x))),length(tree$tip.label)+1:tree$Nnode) (The setNames ensures that your resultant vector gets the node numbers for names.) This message really