Wednesday, October 14, 2015

Co-phylogenetic plot for trees with no edge lengths

The phytools function plot.cophylo will no plot an object of class "cophylo" containing trees without edge lengths (upon user request).

Here's what I mean:

library(devtools)
install_github("liamrevell/phytools")

Now try it….

library(phytools)
t1<-rtree(n=26,tip.label=LETTERS,br=NULL)
t2<-rtree(n=26,tip.label=LETTERS,br=NULL)
obj<-cophylo(t1,t2)
## Rotating nodes to optimize matching...
## Done.
plot(obj)

plot of chunk unnamed-chunk-2

This was super easy. I just plugged the line:

if(is.null(tree$edge.length)) tree<-compute.brlen(tree)

into the internally used plotting function, phylogram, and that was all there was too it.

1 comment:

  1. A few hundred quid will buy you a great watch in it's own right without having to resort to buying a fake. replica rolex watches Certain Seiko watches or small brands such as Smiths or Precista from Timefactors have huge following and rightly so. replica watches ukThey have great, durable mechanical movements and will serve for many years.

    ReplyDelete