Re: [R-sig-phylo] Collapsing nodes using node.labels

2011-09-28 Thread Emmanuel Paradis
Hello Daniel, Try this small manipulation ('tr' is your tree and 'node' stores the label of the node): i - which(tr$node.label == node) j - which(tr$edge[, 2] == i + Ntip(tr)) tr$edge.length[j] - 0 Then di2multi(tr) will do the job. (Hopefully, there's originally no zero-length branch in

Re: [R-sig-phylo] Negative Eigenvalues from Phylo Distance Matrix

2011-09-28 Thread Klaus Schliep
Hi Jonathan, you probably mixed up positive matrices and positive definite matrices. To have only positive eigen values a matrix must be positive definite. Covariance matrices are for example are always positive semi-definite, even though they can contain negative entries. D is symmetric

Re: [R-sig-phylo] Collapsing nodes using node.labels

2011-09-28 Thread Emmanuel Paradis
My suggestion below should work with trees initially with zero-length branch if using a negative value instead of 0, e.g.: tr$edge.length[j] - -1 Then di2multi(tr, tol = -0.5) Emmanuel -Original Message- From: Emmanuel Paradis emmanuel.para...@ird.fr Sender: