Mercurial > repos > greg > insect_phenology_model
comparison insect_phenology_model.R @ 11:d1f2c0634354 draft
Uploaded
author | greg |
---|---|
date | Tue, 27 Feb 2018 13:35:16 -0500 |
parents | 61bc6bd8807d |
children | dd86ee185113 |
comparison
equal
deleted
inserted
replaced
10:61bc6bd8807d | 11:d1f2c0634354 |
---|---|
974 } else { | 974 } else { |
975 for (life_stage in life_stages) { | 975 for (life_stage in life_stages) { |
976 if (life_stage == "Egg") { | 976 if (life_stage == "Egg") { |
977 # Start PDF device driver. | 977 # Start PDF device driver. |
978 dev.new(width=20, height=30); | 978 dev.new(width=20, height=30); |
979 file_path = paste(output_dir, "egg_pop_size.pdf", sep="/"); | 979 file_path = paste(output_dir, "egg_pop.pdf", sep="/"); |
980 pdf(file=file_path, width=20, height=30, bg="white"); | 980 pdf(file=file_path, width=20, height=30, bg="white"); |
981 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); | 981 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); |
982 # Egg population size. | 982 # Egg population size. |
983 maxval = max(eggs+eggs.std_error); | 983 maxval = max(eggs+eggs.std_error); |
984 render_chart(date_labels, "pop_size_by_life_stage", opt$plot_std_error, opt$insect, opt$location, latitude, start_date, end_date, days, maxval, | 984 render_chart(date_labels, "pop_size_by_life_stage", opt$plot_std_error, opt$insect, opt$location, latitude, start_date, end_date, days, maxval, |
986 # Turn off device driver to flush output. | 986 # Turn off device driver to flush output. |
987 dev.off(); | 987 dev.off(); |
988 } else if (life_stage == "Nymph") { | 988 } else if (life_stage == "Nymph") { |
989 # Start PDF device driver. | 989 # Start PDF device driver. |
990 dev.new(width=20, height=30); | 990 dev.new(width=20, height=30); |
991 file_name = paste(tolower(life_stage_nymph), "nymph_pop_size.pdf", sep="_"); | 991 file_name = paste(tolower(life_stage_nymph), "nymph_pop.pdf", sep="_"); |
992 file_path = paste(output_dir, file_name, sep="/"); | 992 file_path = paste(output_dir, file_name, sep="/"); |
993 pdf(file=file_path, width=20, height=30, bg="white"); | 993 pdf(file=file_path, width=20, height=30, bg="white"); |
994 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); | 994 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); |
995 # Nymph population size. | 995 # Nymph population size. |
996 maxval = max(nymphs+nymphs.std_error); | 996 maxval = max(nymphs+nymphs.std_error); |
999 # Turn off device driver to flush output. | 999 # Turn off device driver to flush output. |
1000 dev.off(); | 1000 dev.off(); |
1001 } else if (life_stage == "Adult") { | 1001 } else if (life_stage == "Adult") { |
1002 # Start PDF device driver. | 1002 # Start PDF device driver. |
1003 dev.new(width=20, height=30); | 1003 dev.new(width=20, height=30); |
1004 file_name = paste(tolower(life_stages_adult), "adult_pop_size.pdf", sep="_"); | 1004 file_name = paste(tolower(life_stages_adult), "adult_pop.pdf", sep="_"); |
1005 file_path = paste(output_dir, file_name, sep="/"); | 1005 file_path = paste(output_dir, file_name, sep="/"); |
1006 pdf(file=file_path, width=20, height=30, bg="white"); | 1006 pdf(file=file_path, width=20, height=30, bg="white"); |
1007 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); | 1007 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); |
1008 # Adult population size. | 1008 # Adult population size. |
1009 maxval = max(adults+adults.std_error); | 1009 maxval = max(adults+adults.std_error); |
1012 # Turn off device driver to flush output. | 1012 # Turn off device driver to flush output. |
1013 dev.off(); | 1013 dev.off(); |
1014 } else if (life_stage == "Total") { | 1014 } else if (life_stage == "Total") { |
1015 # Start PDF device driver. | 1015 # Start PDF device driver. |
1016 dev.new(width=20, height=30); | 1016 dev.new(width=20, height=30); |
1017 file_path = paste(output_dir, "total_pop_size.pdf", sep="/"); | 1017 file_path = paste(output_dir, "total_pop.pdf", sep="/"); |
1018 pdf(file=file_path, width=20, height=30, bg="white"); | 1018 pdf(file=file_path, width=20, height=30, bg="white"); |
1019 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); | 1019 par(mar=c(5, 6, 4, 4), mfrow=c(3, 1)); |
1020 # Total population size. | 1020 # Total population size. |
1021 maxval = max(eggs+eggs.std_error, nymphs+nymphs.std_error, adults+adults.std_error); | 1021 maxval = max(eggs+eggs.std_error, nymphs+nymphs.std_error, adults+adults.std_error); |
1022 render_chart(date_labels, "pop_size_by_life_stage", opt$plot_std_error, opt$insect, opt$location, latitude, start_date, end_date, days, maxval, | 1022 render_chart(date_labels, "pop_size_by_life_stage", opt$plot_std_error, opt$insect, opt$location, latitude, start_date, end_date, days, maxval, |