thresholddate<-data.frame(p,d)
View(thresholddate)
thresholddate$d<-as.Date(threshold$d)
thresholddate$d<-as.Date(thresholddate$d)
peakthresh<-merge(peakbrood,thresholddate,by.x="Site",by.y="p",all=T)
View(peakthresh)
peakthresh<-merge(peakbrood,thresholddate,by.x="Site",by.y="p",all.y=T)
View(peakthresh)
?merge
peakthresh<-merge(peakbrood,thresholddate,by.x="Site",by.y="p",all.y=T, all=F)
View(peakthresh)
peakthresh<-merge(peakbrood,thresholddate,by.x="Site",by.y="p",all.y=T, all.x=F)
View(peakthresh)
peakthresh<-merge(peakbrood,thresholddate,by.x="Site",by.y="p",all=F)
View(peakthresh)
peakthresh$time_to_peak<-difftime(peakthresh$Date,peakthresh$d,units="days")
View(peakthresh)
peakthresh2<-peakthresh[c("Date","Site","Pop","d")]
View(peakthresh2)
peakthresh2<-peakthresh[c("Date","Site","Pop","d","time_to_peak")]
View(peakthresh2)
peakthresh2<-rename(peakthresh2,c('Date'='Peak_Date',"Site"="Site","Pop"="Pop","d"="Threshold Date","time_to_peak"="Days_to_Peak"))
View(peakthresh)
View(peakthresh2)
peakthresh2<-peakthresh[c("Date","Site","Pop","Brooders","d","time_to_peak")]
peakthresh2<-rename(peakthresh2,c('Date'='Peak_Date',"Site"="Site","Pop"="Pop","Brooders"="Brooders","d"="Threshold Date","time_to_peak"="Days_to_Peak"))
View(peakthresh2)
View(oysthresh)
View(fidthresh)
oysdd<-ddply(oysmintemp,.(Date),subset,min_temp>=8)
View(oysdd)
fiddd<-ddply(fidmintemp,.(Date),subset,min_temp>=8)
View(fiddd)
mandd<-ddply(manmintemp,.(Date),subset,min_temp>=8)
View(mandd)
oysdd<-oysdd[c(oysdd$Date>="2014-03-06"),]
View(oysdd)
fiddd<-fiddd[c(fiddd$Date>="2014-03-12"),]
mandd<-mandd[c(mandd$Date>="2014-03-11")]
mandd<-mandd[c(mandd$Date>="2014-03-11"),]
View(mandd)
oysdd<-ddply(oysmintemp,.(Date),subset,min_temp>=8)
oysdd<-oysdd[c(oysdd$Date>="2014-03-06"),]
View(oysdd)
oyshndd<-oysdd[c(oysdd$Date<="2014-07-10"),]
oyssdd<-oysdd[c(oysdd$Date<="2014-06-19"),]
View(oyshndd)
View(oyssdd)
fiddd<-ddply(fidmintemp,.(Date),subset,min_temp>=8)
fiddd<-fiddd[c(fiddd$Date>="2014-03-12"),]
View(fiddd)
fidhndd<-fiddd[c(fiddd$Date<="2014-08-08"),]
fidsdd<-fiddd[c(fiddd$Date<="2014-07-11"),]
View(fidhndd)
View(fidsdd)
mandd<-ddply(manmintemp,.(Date),subset,min_temp>=8)
mandd<-mandd[c(mandd$Date>="2014-03-11"),]
View(mandd)
manhsdd<-mandd[c(mandd$Date>="2014-08-06"),]
manndd<-mandd[c(mandd$Date>="2014-06-25"),]
View(manhsdd)
View(manndd)
manhsdd<-mandd[c(mandd$Date<="2014-08-06"),]
manndd<-mandd[c(mandd$Date<="2014-06-25"),]
oyshndd$tempdiff<-oyshndd$min_temp-8
View(oyshndd)
oyssdd$tempdiff<-oyssdd$min_temp-8
fidhndd$tempdiff<-fidhndd$min_temp-8
fidsdd$tempdiff<-fidsdd$min_temp-8
manhsdd$tempdiff<-manhsdd$min_temp-8
manndd$tempdiff<-manndd$min_temp-8
View(oyshndd)
View(oyssdd)
View(fidhndd)
View(fidsdd)
View(manhsdd)
View(manndd)
oyshn<-colSums(oyshndd$tempdiff)
oyss<-colSums(oyssdd$tempdiff)
oyshn<-colSums(oyshndd)
oyshn<-colSums(oyshndd,dims=2)
oyshn<-colSums(oyshndd,dims=1)
oyshn<-colSums(oyshndd$tempdiff,dims=1)
oyshn<-rowSums(oyshndd$tempdiff)
oyshn<-rowSums(oyshndd)
oyshn<-colSums(oyshndd[,-1])
oyshn<-colSums(oyshndd[,-2])
oyshn<-colSums(oyshndd[,-1])
oyshn<-colSums(oyshndd[,-1])
oyss<-colSums(oyssdd[,-1])
fidhn<-colSums(fidhndd[,-1])
fids<-colSums(fidsdd[,-1])
manhs<-colSums(manhsdd[,-1])
mann<-colSums(manndd[,-1])
DegreeDays<-c(oyshndd,oyshndd,oyssdd,fidhndd,fidhndd,fidsdd,manhsdd,manndd,manhsdd)
Pop<-c("H","N","S")
Site<-c("Oyster Bay","Oyster Bay","Oyster Bay","Fidalgo","Fidalgo","Fidalgo","Manchester","Manchester","Manchester")
Degree<-data.frame(DegreeDays,Pop,Site)
DegreeDaysDF<-as.data.frame(DegreeDays)
print(DegreeDays)
DegreeDays<-as.data.frame(c(oyshndd,oyshndd,oyssdd,fidhndd,fidhndd,fidsdd,manhsdd,manndd,manhsdd))
?data.frame
Degree<-data.frame(Pop,Site)
View(Degree)
colSums(oyshndd[,-1])
colSums(oyssdd[,-1])
colSums(fidhndd[,-1])
colSums(fidsdd[,-1])
fidsdd<-fiddd[c(fiddd$Date<="2014-07-11"),]
fidsdd$tempdiff<-fidsdd$min_temp-8
colSums(fidsdd[,-1])
fidhndd<-fiddd[c(fiddd$Date<="2014-08-08"),]
fidhndd$tempdiff<-fidhndd$min_temp-8
colSums(fidhndd[,-1])
View(fidhndd)
View(fidsdd)
fidhndd<-fiddd[c(fiddd$Date<="2014-08-08"),]
View(fidhndd)
fiddd<-ddply(fidmintemp,.(Date),subset,min_temp>=8)
View(fiddd)
fidy1v3$Date<-as.Date(fidy1v3$Date,"%m/%d/%Y")
fidy1v3<-read.csv("TempData/fidy1v3.csv")
fidy1v3$Date<-as.Date(fidy1v3$Date,"%m/%d/%Y")
fidmintemp<-ddply(fidy1v3,.(Date),summarise,min_temp=min(Temp,na.rm=T))
fiddd<-ddply(fidmintemp,.(Date),subset,min_temp>=8)
View(fiddd)
fiddd<-fiddd[c(fiddd$Date>="2014-03-12"),]
View(fiddd)
fidhndd<-fiddd[c(fiddd$Date<="2014-08-08"),]
fidsdd<-fiddd[c(fiddd$Date<="2014-07-11"),]
fidhndd$tempdiff<-fidhndd$min_temp-8
fidsdd$tempdiff<-fidsdd$min_temp-8
colSums(fidhndd[,-1])
colSums(fidsdd[,-1])
colSums(manhsdd[,-1])
colSums(manndd[,-1])
View(manhsdd)
DegreeDays<-c("512.999","512.999","354.156","454.615","454.615","309.488","377.561","175.322","377.561")
Degree<-data.frame(Site,Pop,DegreeDays)
View(Degree)
?round
Degree$DegreeDays<-round(Degree$DegreeDays,digits=0)
View(peakthresh2)
peakthresh3<-merge(peakthresh2,Degree,by.x=c("Site","Pop"),by.y=c("Site","Pop"),all=T)
View(peakthresh3)
fidthresh<-ddply(fidmintemp,.(Date),subset,min_temp>=12.5)
fidthresh$Date<-as.Date(fidthresh$Date)
thresholddate<-data.frame(p,d)
thresholddate$d<-as.Date(thresholddate$d)
peakthresh<-merge(peakbrood,thresholddate,by.x="Site",by.y="p",all=F)
peakthresh$time_to_peak<-difftime(peakthresh$Date,peakthresh$d,units="days")
peakthresh2<-peakthresh[c("Date","Site","Pop","Brooders","d","time_to_peak")]
peakthresh2<-rename(peakthresh2,c('Date'='Peak_Date',"Site"="Site","Pop"="Pop","Brooders"="Brooders","d"="Threshold Date","time_to_peak"="Days_to_Peak"))
peakthresh3<-merge(peakthresh2,Degree,by.x=c("Site","Pop"),by.y=c("Site","Pop"),all=T)
View(peakthresh3)
require(ggplot2)
ggplot()+geom_line(oyshndd,aes(x=Date,y=cumsum(tempdiff)))
ggplot()+geom_line(oyshndd,aes(x=Date,y=cumsum(oyshndd$tempdiff)))
ggplot(oyshndd,aes(x=Date,y=cumsum(oyshndd$tempdiff)))+geom_line()
ggplot(oyshndd,aes(x=Date,y=c(cumsum(oyshndd$tempdiff),cumsum(fidhndd$tempdiff),cumsum(manhsdd)))+geom_line()
geom_line()
ggplot(oyshndd,aes(x=Date,y=c(cumsum(oyshndd$tempdiff),cumsum(fidhndd$tempdiff),cumsum(manhsdd))))+geom_line()
ggplot(oyshndd,aes(x=Date,y=c(cumsum(oyshndd$tempdiff),cumsum(fidhndd$tempdiff),cumsum(manhsdd$tempdiff))))+geom_line()
ggplot(oyshndd,aes(x=Date,y=c(cumsum(oyshndd$tempdiff),cumsum(fidhndd$tempdiff),cumsum(manhsdd$tempdiff))))+
geom_line()+xlim(as.Date(c('2014-03-01','2014-08-15')))
geom_line(oyshndd,aes(x=Date,y=cumsum(oyshndd$tempdiff)))+xlim(as.Date(c('2014-03-01','2014-08-15')))
ggplot(oyshndd)+geom_line(aes(x=Date,y=cumsum(oyshndd$tempdiff)))+xlim(as.Date(c('2014-03-01','2014-08-15')))
dddf<-cbind(oyshndd,fidhndd,manhsdd)
?cbind
?merge
of<-merge(oyshndd,fidhndd,by="Date",all=T,incomparables=0)
View(of)
oysdd<-ddply(oysmintemp,.(Date),subset,min_temp>=8)
oysdd<-oysmintemp[c(oysmintemp$Date>="2014-03-06"),]
View(oysdd)
oyshndd<-oysdd[c(oysdd$Date<="2014-07-10"),]
oyssdd<-oysdd[c(oysdd$Date<="2014-06-19"),]
View(oyshndd)
View(oyssdd)
oyshndd$tempdiff<-oyshndd$min_temp-8
oyssdd$tempdiff<-oyssdd$min_temp-8
colSums(oyshndd[,-1])
colSums(oyssdd[,-1])
fiddd<-ddply(fidmintemp,.(Date),subset,min_temp>=8)
fiddd<-fidmintemp[c(fidmintemp$Date>="2014-03-12"),]
View(fiddd)
fidhndd<-fiddd[c(fiddd$Date<="2014-08-08"),]
fidsdd<-fiddd[c(fiddd$Date<="2014-07-11"),]
View(fidhndd)
View(fidsdd)
fidhndd$tempdiff<-fidhndd$min_temp-8
fidsdd$tempdiff<-fidsdd$min_temp-8
colSums(fidhndd[,-1])
colSums(fidsdd[,-1])
mandd<-ddply(manmintemp,.(Date),subset,min_temp>=8)
mandd<-manmintemp[c(manmintemp$Date>="2014-03-11"),]
View(mandd)
manhsdd<-mandd[c(mandd$Date<="2014-08-06"),]
manndd<-mandd[c(mandd$Date<="2014-06-25"),]
View(manhsdd)
View(manndd)
manhsdd$tempdiff<-manhsdd$min_temp-8
manndd$tempdiff<-manndd$min_temp-8
colSums(manhsdd[,-1])
colSums(manndd[,-1])
DegreeDays<-c("512.999","512.999","354.156","454.615","454.615","309.488","377.561","175.322","377.561")
Pop<-c("H","N","S")
Site<-c("Oyster Bay","Oyster Bay","Oyster Bay","Fidalgo","Fidalgo","Fidalgo","Manchester","Manchester","Manchester")
Degree<-data.frame(Site,Pop,DegreeDays)
peakthresh3<-merge(peakthresh2,Degree,by.x=c("Site","Pop"),by.y=c("Site","Pop"),all=T)
DegreeDays<-c("512.999","512.999","354.156","453.021","453.021","307.894","377.561","175.322","377.561")
Pop<-c("H","N","S")
Site<-c("Oyster Bay","Oyster Bay","Oyster Bay","Fidalgo","Fidalgo","Fidalgo","Manchester","Manchester","Manchester")
Degree<-data.frame(Site,Pop,DegreeDays)
peakthresh3<-merge(peakthresh2,Degree,by.x=c("Site","Pop"),by.y=c("Site","Pop"),all=T)
of<-merge(oyshndd,fidhndd,by="Date",all=T,incomparables=0)
View(of)
of<-merge(oyshndd,fidhndd,by="Date",all=T,incomparables="0")
View(of)
dddf<-merge(of,manhsdd,by="Date",all=T,incomparables="0")
View(dddf)
dddf[is.na(dddf)]<-0
View(dddf)
dddf<-rename(dddf,c('Date'='Date','min_temp.x'='oysmin','tempdiff.x'='oystempdiff','min_temp.y'='fidmin','tempdiff.y'='fidtempdiff','min_temp'='manmin','tempdiff'='mantempdiff'))
View(dddf)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)))+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff))+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif))+
xlim(as.Date(c('2014-03-01','2014-08-15')))
)
)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)))+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)))+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)))
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")
View(peakthresh3)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(intercept=as.Date("2014-06-03",'%Y-%m-%d'),color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(xintercept=as.Date("2014-06-03",'%Y-%m-%d'),color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(xintercept="2014-06-03",color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(xintercept=as.Date("2014-06-03"),color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(xintercept=2014-06-03,color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(xintercept=as.Date(2014-06-03),color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(xintercept=as.Date("2014-06-03"),color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
geom_vline(x=as.Date("2014-06-03"),color="purple")
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=125)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=130)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=135)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='green')
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='green',pch=15)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=160,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=100,size=5,color='red',pch=15)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=145,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=110,size=5,color='red',pch=15)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=5,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=5,color='blue',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=5,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=5,color='purple',pch=3)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=5,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=5,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=5,color='orange',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=5,color='orange',pch=3)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=5,color='orange',pch=3)+
theme_bw()
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=5,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=5,color='blue',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=5,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=5,color='purple',pch=3)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=5,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=5,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=5,color='orange',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=5,color='orange',pch=3)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=5,color='orange',pch=3)+
theme_bw()
ggplot(dddf)+geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange")+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple")+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red")+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=3)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=3)+
theme_bw()
ggplot(dddf)+
geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange",size=3)+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple",size=3)+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red",size=3)+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=3)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=3)+
theme_bw()
ggplot(dddf)+
geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red",size=2)+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=3)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=3)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=3)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=3)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=3)+
theme_bw()
ggplot(dddf)+
geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red",size=2)+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=13)+
theme_bw()
ggplot(dddf)+
geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red",size=2)+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=13)+
theme_bw()+
labs(title="Degree Days compared between Sites and Populations",x="Date",y="Cumulative Degrees over 8 C Minimum")
ggplot(dddf)+
geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red",size=2)+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=13)+
theme_bw()+
labs(title="Degree Days compared between Sites and Populations",x="Date",y="Cumulative Degrees over 8 C Minimum")
odd<-oysdd[c(oysdd$Date<="2014-08-15"),]
fdd<-fiddd[c(fiddd$Date<="2014-08-15"),]
mdd<-mandd[c(mandd$Date<="2014-08-15"),]
of<-merge(odd,fdd,by="Date",all=T,incomparables="0")
dddf<-merge(of,mdd,by="Date",all=T,incomparables="0")
dddf[is.na(dddf)]<-0
dddf<-rename(dddf,c('Date'='Date','min_temp.x'='oysmin','tempdiff.x'='oystempdiff','min_temp.y'='fidmin','tempdiff.y'='fidtempdiff','min_temp'='manmin','tempdiff'='mantempdiff'))
View(dddf)
odd<-oysdd[c(oysdd$Date<="2014-08-15"),]
odd$tempdiff<-odd$min_temp-8
fdd<-fiddd[c(fiddd$Date<="2014-08-15"),]
fdd$tempdiff<-fdd$min_temp-8
mdd<-mandd[c(mandd$Date<="2014-08-15"),]
mdd$tempdiff<-mdd$min_temp-8
of<-merge(odd,fdd,by="Date",all=T,incomparables="0")
dddf<-merge(of,mdd,by="Date",all=T,incomparables="0")
#we need to clean up the NAs produced so that these can be graphed in ggplot2
dddf[is.na(dddf)]<-0
#Now we rename the columns to meaningful titles
dddf<-rename(dddf,c('Date'='Date','min_temp.x'='oysmin','tempdiff.x'='oystempdiff','min_temp.y'='fidmin','tempdiff.y'='fidtempdiff','min_temp'='manmin','tempdiff'='mantempdiff'))
#check the data frame to make sure that everything aligns to the X axis dates of interest with the right tempdiff numbers
View(dddf)
mandd<-manmintemp[c(manmintemp$Date>="2014-03-06"),]
fiddd<-fidmintemp[c(fidmintemp$Date>="2014-03-06"),]
oysdd<-oysmintemp[c(oysmintemp$Date>="2014-03-06"),]
odd<-oysdd[c(oysdd$Date<="2014-08-15"),]
odd$tempdiff<-odd$min_temp-8
fdd<-fiddd[c(fiddd$Date<="2014-08-15"),]
fdd$tempdiff<-fdd$min_temp-8
mdd<-mandd[c(mandd$Date<="2014-08-15"),]
mdd$tempdiff<-mdd$min_temp-8
of<-merge(odd,fdd,by="Date",all=T,incomparables="0")
dddf<-merge(of,mdd,by="Date",all=T,incomparables="0")
#we need to clean up the NAs produced so that these can be graphed in ggplot2
dddf[is.na(dddf)]<-0
#Now we rename the columns to meaningful titles
dddf<-rename(dddf,c('Date'='Date','min_temp.x'='oysmin','tempdiff.x'='oystempdiff','min_temp.y'='fidmin','tempdiff.y'='fidtempdiff','min_temp'='manmin','tempdiff'='mantempdiff'))
#check the data frame to make sure that everything aligns to the X axis dates of interest with the right tempdiff numbers
View(dddf)
ggplot(dddf)+
geom_line(aes(x=Date,y=cumsum(dddf$oystempdiff)),color="orange",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$fidtempdiff)),color="purple",size=2)+
geom_line(aes(x=Date,y=cumsum(dddf$mantempdif)),color="red",size=2)+
annotate("point",x=as.Date("2014-06-03",'%Y-%m-%d'),y=133,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-05-14",'%Y-%m-%d'),y=143,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-06-08",'%Y-%m-%d'),y=113,size=5,color='red',pch=15)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=460,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=383,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=520,size=10,color='blue',pch=13)+
annotate("point",x=as.Date("2014-08-08",'%Y-%m-%d'),y=453.021,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-06-25",'%Y-%m-%d'),y=175.322,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-10",'%Y-%m-%d'),y=512.999,size=10,color='purple',pch=13)+
annotate("point",x=as.Date("2014-07-11",'%Y-%m-%d'),y=307.894,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-08-06",'%Y-%m-%d'),y=377.561,size=10,color='orange',pch=13)+
annotate("point",x=as.Date("2014-06-19",'%Y-%m-%d'),y=354.156,size=10,color='orange',pch=13)+
theme_bw()+
labs(title="Degree Days compared between Sites and Populations",x="Date",y="Cumulative Degrees over 8 C Minimum")
