Mercurial > repos > greg > insect_phenology_model
comparison insect_phenology_model.R @ 94:89492de287a6 draft
Uploaded
author | greg |
---|---|
date | Fri, 01 Dec 2017 09:49:09 -0500 |
parents | 06acadd38824 |
children | f0c65c9f1078 |
comparison
equal
deleted
inserted
replaced
93:06acadd38824 | 94:89492de287a6 |
---|---|
572 start_date <- temperature_data_frame$DATE[1] | 572 start_date <- temperature_data_frame$DATE[1] |
573 end_date <- temperature_data_frame$DATE[opt$num_days] | 573 end_date <- temperature_data_frame$DATE[opt$num_days] |
574 | 574 |
575 # Subfigure 1: population size by life stage | 575 # Subfigure 1: population size by life stage |
576 title <- paste(opt$insect, ": Total pop. by life stage :", opt$location, ": Lat:", latitude, ":", start_date, "-", end_date, sep=" ") | 576 title <- paste(opt$insect, ": Total pop. by life stage :", opt$location, ": Lat:", latitude, ":", start_date, "-", end_date, sep=" ") |
577 plot(day.all, mean_value_adult, main=title, type="l", ylim=c(0, max(mean_value_egg + mean_value_egg.se, mean_value_nymph + mean_value_nymph.se, mean_value_adult + mean_value_adult.se)), axes=F, lwd=2, xlab="", ylab="", cex=3, cex.lab=3, cex.axis=3, cex.main=3) | 577 plot(day.all, mean_value_adult, main=title, type="l", ylim=c(0, max(mean_value_egg + mean_value_egg.std_error, mean_value_nymph + mean_value_nymph.std_error, mean_value_adult + mean_value_adult.std_error)), axes=F, lwd=2, xlab="", ylab="", cex=3, cex.lab=3, cex.axis=3, cex.main=3) |
578 # Young and old nymphs. | 578 # Young and old nymphs. |
579 lines(day.all, mean_value_nymph, lwd=2, lty=1, col=2) | 579 lines(day.all, mean_value_nymph, lwd=2, lty=1, col=2) |
580 # Eggs | 580 # Eggs |
581 lines(day.all, mean_value_egg, lwd=2, lty=1, col=4) | 581 lines(day.all, mean_value_egg, lwd=2, lty=1, col=4) |
582 axis(1, at=c(1:12) * 30 - 15, cex.axis=3, labels=c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")) | 582 axis(1, at=c(1:12) * 30 - 15, cex.axis=3, labels=c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")) |
584 leg.text <- c("Egg", "Nymph", "Adult") | 584 leg.text <- c("Egg", "Nymph", "Adult") |
585 legend("topleft", leg.text, lty=c(1, 1, 1), col=c(4, 2, 1), cex=3) | 585 legend("topleft", leg.text, lty=c(1, 1, 1), col=c(4, 2, 1), cex=3) |
586 if (opt$se_plot == 1) { | 586 if (opt$se_plot == 1) { |
587 # Add Standard error lines to plot | 587 # Add Standard error lines to plot |
588 # Standard error for adults | 588 # Standard error for adults |
589 lines (day.all, mean_value_adult+mean_value_adult.se, lty=2) | 589 lines (day.all, mean_value_adult+mean_value_adult.std_error, lty=2) |
590 lines (day.all, mean_value_adult-mean_value_adult.se, lty=2) | 590 lines (day.all, mean_value_adult-mean_value_adult.std_error, lty=2) |
591 # Standard error for nymphs | 591 # Standard error for nymphs |
592 lines (day.all, mean_value_nymph+mean_value_nymph.se, col=2, lty=2) | 592 lines (day.all, mean_value_nymph+mean_value_nymph.std_error, col=2, lty=2) |
593 lines (day.all, mean_value_nymph-mean_value_nymph.se, col=2, lty=2) | 593 lines (day.all, mean_value_nymph-mean_value_nymph.std_error, col=2, lty=2) |
594 # Standard error for eggs | 594 # Standard error for eggs |
595 lines (day.all, mean_value_egg+mean_value_egg.se, col=4, lty=2) | 595 lines (day.all, mean_value_egg+mean_value_egg.std_error, col=4, lty=2) |
596 lines (day.all, mean_value_egg-mean_value_egg.se, col=4, lty=2) | 596 lines (day.all, mean_value_egg-mean_value_egg.std_error, col=4, lty=2) |
597 } | 597 } |
598 | 598 |
599 # Subfigure 2: population size by generation | 599 # Subfigure 2: population size by generation |
600 title <- paste(opt$insect, ": Total pop. by generation :", opt$location, ": Lat:", latitude, ":", start_date, "-", end_date, sep=" ") | 600 title <- paste(opt$insect, ": Total pop. by generation :", opt$location, ": Lat:", latitude, ":", start_date, "-", end_date, sep=" ") |
601 plot(day.all, g0, main=title, type="l", ylim=c(0, max(g2)), axes=F, lwd=2, xlab="", ylab="", cex=3, cex.lab=3, cex.axis=3, cex.main=3) | 601 plot(day.all, g0, main=title, type="l", ylim=c(0, max(g2)), axes=F, lwd=2, xlab="", ylab="", cex=3, cex.lab=3, cex.axis=3, cex.main=3) |