I have started working on a new mini-project, called
the intention of creating a variety of “free-hand” functions that
will allow the user to draw trees on the screen in R which then will
be turned into objects of class
"phylo" for use in other
functions or methods.
The inspiration for this comes from the function that I wrote about a week ago to draw a phylogeny on top of a raster image of a plotted tree, along with some other related methods that I have in mind.
The package - though consisting so far of only this one function
phylo.tracer) can already be downloaded & installed
from GitHub using devtools. I added a couple of features to the function.
In particular, it can now take either a file name of an image in .jpg format
or a raster image as input (consequentially depending on the package
jpeg, and it now
by default overlays grid lines on the plotted raster image to help the
user more easily identify the branching points of common ancestors on
Here is a quick demo - first of the installation from GitHub:
library(physketch) download.file("http://www.nature.com/nature/journal/v477/n7365/images/nature10382-f4.2.jpg", "nature10382-f4.2.jpg",mode="wb") mollusca<-phylo.tracer(file="nature10382-f4.2.jpg")
and, of course, the result:
Note that the tip order changes depending on the the order in which tips are added to the tree - but, rest assured, the topology & branch lengths are correct.
Finally, this example comes from Kocot et al. (2011).