Description Usage Arguments Author(s) Examples
Compares phylogenetic trees and maps them into a small number of dimensions for easy visualisation and identification of clusters.
1 2 |
x |
an object of the class multiPhylo |
method |
the method for summarising the tree as a vector.
Choose from:
|
nf |
the number of principal components to retain |
return.tree.vectors |
option to also return the tree vectors. Note that this can use a lot of memory so defaults to |
... |
further arguments to be passed to |
Thibaut Jombart thibautjombart@gmail.com
Michelle Kendall michelle.louise.kendall@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## generate list of trees
x <- rmtree(10, 20)
names(x) <- paste("tree", 1:10, sep = "")
## use treescape
res <- treescape(x, nf=3)
table.paint(as.matrix(res$D))
scatter(res$pco)
data(woodmiceTrees)
woodmiceDists <- treescape(woodmiceTrees,nf=3)
plot(woodmiceDists$pco$li[,1],woodmiceDists$pco$li[,2])
woodmicedf <- woodmiceDists$pco$li
if(require(ggplot2)){
woodmiceplot <- ggplot(woodmicedf, aes(x=A1, y=A2)) # create plot
woodmiceplot + geom_density2d(colour="gray80") + # contour lines
geom_point(size=6, shape=1, colour="gray50") + # grey edges
geom_point(size=6, alpha=0.2, colour="navy") + # transparent blue points
xlab("") + ylab("") + theme_bw(base_family="") # remove axis labels and grey background
}
## Not run:
if(require(rgl)){
plot3d(woodmicedf[,1], woodmicedf[,2], woodmicedf[,3], type="s", size=1.5,
col="navy", alpha=0.5, xlab="", ylab="", zlab="")
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.