Title: MSH tree manipulations and basic survey results
Name: Tammy L. Elliott
Date: March 15, 2017
R version 3.1
Plot vascular tree and angiosperm tree side-by-side
#dev.new(width=8, height=4.5)
par(mai=c(0.1,0.1,0.1,0.1),oma=c(0.25,0.5,1,0.5))
par(mfrow=c(1,2))
plot(MSH.tree, type="fan", edge.width = 2, show.tip.label=FALSE)
plot(MSH_angiosperms, type="fan", edge.width = 2, show.tip.label=FALSE)

Survey results for comparison between temporal surveys
# Numbers of each group
#levels(survey$List_status)
## A="Additions to list"
## Both="Found during both surveys"
## NF = "Not found during 2012-2014 survey"
(A<-sum(survey$List_status=="A"))
## [1] 198
(Both<-sum(survey$List=="Both"))
## [1] 415
(NF<-sum(survey$List=="NF"))
## [1] 70
Species categorizations
Tree 1 shows temporal survey results where light grey are additions, black species on both lists, and medium grey were species not found
Tree2 shows species status on conservation list were black is non-susceptible, white is vulnerable, light grey menaced and darker grey susceptible
Tree 3 is Quebec status list where black is native, lightest grey introduced

Species categorizations
Tree 1 shows temporal survey results where blue are additions, black species on both lists, and red were species not found
Tree2 shows species status on conservation list were black is non-susceptible, white is vulnerable, red menaced and blue susceptible
Tree 3 is Quebec status list where black is native, red introduced; ephemeral white and excluded blue

Plot Maycock (left) and current (right) phylogeny side-by-side
#dev.new(width=8, height=4.5)
par(mai=c(0.1,0.1,0.1,0.1),oma=c(0.25,0.5,1,0.5))
par(mfrow=c(1,2))
plot(MSH_Maycock, type="fan", edge.width = 1, show.tip.label=FALSE)
plot(MSH_current, type="fan", edge.width = 1, show.tip.label=FALSE)

Conservation status summary
levels(survey$Conservation_status)
## [1] "M" "NS" "S" "VR"
# "M"="Menacee"
# "NS"="Non-susceptible"
# "S"="Susceptible"
# "VR"="Vulnerable"
(M<-sum(survey$Conservation_status=="M"))
## [1] 2
(NS<-sum(survey$Conservation_status=="NS"))
## [1] 650
(S<-sum(survey$Conservation_status=="S"))
## [1] 24
(VR<-sum(survey$Conservation_status=="VR"))
## [1] 7
# Create 'communities' for each of the above conservation status categories
M_community_alldata<-survey[which(survey$Conservation_status=="M"),]
M_community<-M_community_alldata$Code
NS_community_alldata<-survey[which(survey$Conservation_status=="NS"),]
NS_community<-NS_community_alldata$Code
S_community_alldata<-survey[which(survey$Conservation_status=="S"),]
S_community<-S_community_alldata$Code
VR_community_alldata<-survey[which(survey$Conservation_status=="VR"),]
VR_community<-VR_community_alldata$Code
Quebec distribution survey
levels(survey$Quebec_distribution)
## [1] "Eph" "Exc" "I" "N"
# "E" = "Ephemeral"
# "Exc" = "Excluded"
# "I" = "Introducted"
# "N" = "Native"
(E<-sum(survey$Quebec_distribution=="E"))
## [1] 0
(Exc<-sum(survey$Quebec_distribution=="Exc"))
## [1] 2
(I<-sum(survey$Quebec_distribution=="I"))
## [1] 154
(N<-sum(survey$Quebec_distribution=="N"))
## [1] 526
##Percentage of Maycock.list that are introduced
(Maycock.percent.introduced<-nrow(Maycock.list.introduced)/(nrow(Maycock.list))*100)
## [1] 14.51943
##Percentage of Current that are introduced
(Current.percent.introduced<-nrow(Current.list.introduced)/(nrow(MSH.current.list))*100)
## [1] 23.98042
#Percentage of Maycock that have Quebec conservation status
Maycock.list.conservation<-Maycock.list[which(Maycock.list$Conservation_status=="M"|Maycock.list$Conservation_status=="S"|Maycock.list$Conservation_status=="VR"),]
nrow(Maycock.list.conservation)
## [1] 22
#Percentage of Maycock.list that have conservation status
(Maycock.percent.conservation<-nrow(Maycock.list.conservation)/(nrow(Maycock.list))*100)
## [1] 4.498978
#Percentage of MSH.current that have Quebec conservation status
MSH.current.list.conservation<-MSH.current.list[which(MSH.current.list$Conservation_status=="M"|MSH.current.list$Conservation_status=="S"|MSH.current.list$Conservation_status=="VR"),]
nrow(MSH.current.list.conservation)
## [1] 25
#percentage of MSH.current.list that have Quebec conservation status
(MSH.current.percent.conservation<-nrow(MSH.current.list.conservation)/(nrow(MSH.current.list))*100)
## [1] 4.078303
#Percentage of MSH.current.list that have Quebec conservation status; not found
MSH.current.list.conservation.notfound<-MSH.current.list[which(MSH.current.list$Conservation_status=="M"|MSH.current.list$Conservation_status=="S"|MSH.current.list$Conservation_status=="VR"& MSH.current.list$List_status=="NF"),]
nrow(MSH.current.list.conservation.notfound)
## [1] 18
#percentage of MSH.current.list that have Quebec conservation status; Not found
(MSH.current.percent.conservation.notfound<-nrow(MSH.current.list.conservation.notfound)/(nrow(MSH.current.list))*100)
## [1] 2.936378