knitr::opts_chunk$set(echo = TRUE)
The aptg package is used to generate phylogenetic trees from a vector of species names or a tree of a taxon down to whatever taxon that is included in the first one. The phylogenetic tree are generated from brranching::phylomatic based on the program of the same name accessible there : http://phylodiversity.net/phylomatic/.
When the tree is generated from a vector of species names, distance matrices are given.
library(aptg)
The function needs a vector or list of strings of species name as an input and will give phylogenetic trees and distance matrices as an output. Let's do an example with a mixed list of mammal and angiosperm species.
taxa.tree(species = c("Canis lupus", "Canis latrans", "Acer saccharum", "Castor canadensis", "Alces alces", "Acer rubrum", "Vulpes vulpes", "Salix babylonica", "Odocoileus virginianus", "Betula alleghaniensis", "Rangifer tarandus","Juniperus occidentalis"))
As you can see the taxa have been sorted by reference trees; mammals and angiosperms. The distance matrices are also an output (not shown here).
This function creates a phylogenetic tree from a taxon down to another one. For now, only the input species gives a result, but any higher taxon can be choosed.
Sys.setenv(ENTREZ_KEY="2a3e497f3b180829c87cafafac7a122d9f09") #API key for NCBI downto.tree("Cervidae", "species")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.