Installation

You can install jsPhyloSVG from github with:

# install.packages("devtools")
devtools::install_github("USCBiostats/jsPhyloSVG")

Example

In the following, we present an example of usage of the widget. First, using the ape package, we create a random phylogenetic tree.

library(ape)
library(jsPhyloSVG)
x <- rtree(10)

Using the plot.ape method, we can get a nice tree drawn with ape:

plot(x)

Using the jsPhyloSVG function, we can visualize the same tree but using the Javascript library of the same name, jsPhyloSVG:

jsPhyloSVG(write.tree(x), width = 500)