---
title: "Salamander phylogeny of 44 species"
output: html_document
---

```{r}
#install.packages("phytools")
rm(list=ls())
library(phytools)
library(ape)
library(MASS)
library(stringr)
library(scales)
library(ggplot2) 
library(ggtree)
library(dplyr)
library(httr)

tree<-read.tree("http://tonyjhwueng.info/phymvrates/ple.nwk")
tipl<-tree$tip.label
tree$tip.label<-str_replace_all(tree$tip.label,"Plethodon","P.")
plot(tree)

df<-read.csv("http://tonyjhwueng.info/phymvrates/Adams2012-SystBiolData.csv")
df$spname<-tree$tip.label
df$spname %in% tree$tip.label
tree$tip.label %in% df$spname  

df<-df[match(tree$tip.label, df$spname) ,] 
traitset<-df[,2:4]
rownames(traitset)<-tree$tip.label

dotTree(tree,traitset,standardize=FALSE,length=6,colors="orange")


```