-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBurkeetal_ThawPondRSPaper_Rcode.R
1950 lines (1790 loc) · 96.4 KB
/
Burkeetal_ThawPondRSPaper_Rcode.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
###################################################################################
# (c) Author: Sophia Burke
# Institute for the Study of Earth Oceans and Space
# University of New Hampshire
# Original File Created : May 28, 2020
# File Modified : April 16, 2024
# contact: [email protected]; [email protected]
# This is the source code for figures and statistics presented in
# Burke et al. 2024 manuscript entitled: Connecting Methane Flux to
# Thaw Pond size using Unpiloted Aerial Systems.
# Other citations of note: Burke, S.A., Wik, M., Lang, A., Contosta, A.R.,
# Palace, M., Crill, P.M., Varner, R.K., 2019. Long‐Term Measurements of
# Methane Ebullition From Thaw Ponds. J. Geophys. Res. Biogeosci.
# 2018JG004786. https://doi.org/10.1029/2018JG004786
# the data loaded into this file is available on the EMERGE Github in a public
# repository:
# The input data file is called: /Stordalen_ThawPond_UASPolygons_2014to2018.csv
# The columns are:
# FlightDate: YYYY-MM-DD, time zone: CET
# Field_ID: original pond identifier used in field notes
# Burkeetl2019_ID: Pond ID used in figures in this paper, following the ID
# used in Burke et al. (2019)
# UAStype: Either 'FWing' for Fixed Wing, or 'Quad' for Quadcopter
# PolygonType: Either 'pondedge' for Pond Depression Polygon, or 'water' for Water
# Polygon
# PondType: Either 1,2,3 or 4. See Burke et al. (2019) for complete description
# of each type
# area_m2: area of the polygon (m2) -- calculated in QGIS
# edge_m: perimeter (edge) length of the polygon (m) -- calculated in QGIS
# edge.area: edge divided by area of the polygon -- calculated in QGIS
# Median8dC_BubFlux: Median daily bubbly flux from each thaw pond calculated
# across a eight day window centered on each flight date.
# Cumulative_BubFlux: Total CH4 flux per m2 emitted in the corresponding
# field season of each UAS flight
# TotPrec_8dpreflight : Total precipitation (mm) measured in the eight days
# leading up to and including each flight date
# See ReadMe_StordalenMire_ThawPond_UASPolygons_2014to2018.txt for more details
# Note: any #comment# that appears in this code refers to the line of code below it.
# Note: Reference to Pond Edge Area (PEA) in this code is the same as Pond Depression
# Area as in the manuscript.
####################################################################################
## load in necessary packages (what functions they provide)##########################
library(tidyr) # (separate function)
library(plyr) # (ddply function)
library(dunn.test) #(dunn.test function)
library(dplyr) #(distinct function)
library(agricolae) #(kruskal function)
library(PMCMRplus) # (dscfAllPairsTest function)
#####
#####
# load in the UAS data into R and format it #######################################
RSEdataframe_all <- read.csv(
".\\StordalenMire_ThawPond_UASPolygons_2014to2018.csv", header = TRUE)
# format the column containing Burkeetal2019_ID
RSEdataframe_all$Burkeetal2019_ID <- as.factor(RSEdataframe_all$Burkeetal2019_ID)
# format the column containing FlightDate
RSEdataframe_all$FlightDate <- as.POSIXct(RSEdataframe_all$FlightDate,
format = "%Y-%m-%d", tz = "CET")
# create a column containing only the numerical month of each flight
RSEdataframe_all$month <- as.numeric(strftime(RSEdataframe_all$FlightDate,
"%m", tz = "CET"))
# create a column containing only the numerical year of each flight
RSEdataframe_all$year <- as.numeric(strftime(RSEdataframe_all$FlightDate,
"%Y", tz = "CET"))
# create a column containing only the numerical day of year (doy) of each flight
RSEdataframe_all$doy <- as.numeric(strftime(RSEdataframe_all$FlightDate,
"%j", tz = "CET"))
# create a unique grouping identifier that combines the Burkeetal2019_ID and the year
RSEdataframe_all$PondYr <- paste(RSEdataframe_all$Burkeetal2019_ID,
RSEdataframe_all$year,sep = " ")
#create a unique grouping identifier that combines the Month and the Year
RSEdataframe_all$MonthYr <- paste(RSEdataframe_all$month,
RSEdataframe_all$year, sep = " ")
# create unique grouping identifier that combines the Flight date and Pond and UAS
RSEdataframe_all$FlightDatePondUAS <-paste(RSEdataframe_all$FlightDate,
RSEdataframe_all$Burkeetal2019_ID,
RSEdataframe_all$UAStype, sep = " ")
#######################################################################################
# create appropriate subsets of the RSEdataframe_all for plotting and stats
Quad_PondEdge_PondPolygons <- subset(RSEdataframe_all,
RSEdataframe_all$UAStype == "Quad" &
RSEdataframe_all$PolygonType == "pondedge")
Quad_Water_PondPolygons <- subset(RSEdataframe_all,
RSEdataframe_all$UAStype == "Quad" &
RSEdataframe_all$PolygonType == "water")
FWing_PondEdge_PondPolygons <- subset(RSEdataframe_all,
RSEdataframe_all$UAStype == "FWing" &
RSEdataframe_all$PolygonType == "pondedge")
FWing_Water_PondPolygons <- subset(RSEdataframe_all,
RSEdataframe_all$UAStype == "FWing" &
RSEdataframe_all$PolygonType == "water")
AllPondEdge_QuadFWing_Polygons <- subset(RSEdataframe_all,
RSEdataframe_all$PolygonType == "pondedge")
AllWater_QuadFWing_Polygons <- subset(RSEdataframe_all, RSEdataframe_all$PolygonType == "water")
AllWater_QuadFWing_Polygons_PondA <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "A")
AllWater_QuadFWing_Polygons_PondB <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "B")
AllWater_QuadFWing_Polygons_PondC <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "C")
AllWater_QuadFWing_Polygons_PondD <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "D")
AllWater_QuadFWing_Polygons_PondE <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "E")
AllWater_QuadFWing_Polygons_PondF <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "F")
AllWater_QuadFWing_Polygons_PondH <- subset(AllWater_QuadFWing_Polygons,
AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "H")
#subsets for Figure S4,S5,S7
Quad_Water_PondPolygons_PondA <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "A")
Quad_Water_PondPolygons_PondB <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "B")
Quad_Water_PondPolygons_PondC <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "C")
Quad_Water_PondPolygons_PondD <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "D")
Quad_Water_PondPolygons_PondE <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "E")
Quad_Water_PondPolygons_PondF <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "F")
Quad_Water_PondPolygons_PondH <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$Burkeetal2019_ID == "H")
# subsets for Figure S6, S9
AllPondEdge_QuadFWing_PondA <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "A")
AllPondEdge_QuadFWing_PondB <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "B")
AllPondEdge_QuadFWing_PondC <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "C")
AllPondEdge_QuadFWing_PondD <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "D")
AllPondEdge_QuadFWing_PondE <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "E")
AllPondEdge_QuadFWing_PondF <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "F")
AllPondEdge_QuadFWing_PondH <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID == "H")
#subset the Quad_Water_PondPolygons matrix to only containg data from the month of July
Quad_Water_PondPolygons_JulyOnly <- subset(Quad_Water_PondPolygons,
Quad_Water_PondPolygons$month == 7)
## summarizing the data using ddply################################################################
# summarize the water polygon area data collected with the Quadcopter UAS by month
# calculate the median, maximum, and minimum water polygon area (m2) for
# all ponds across the different sampling seasons.
Summary_QuadWA_month <- ddply(Quad_Water_PondPolygons,.(month),summarize,
Median_QWA = median(area_m2,na.rm = TRUE),
Max_QWA = max(area_m2,na.rm = TRUE),
Min_QWA = min(area_m2,na.rm = TRUE))
# summarize the pond edge polygon area data collected with both the Quadcopter
# and Fixed Wing UAS by year
# calculate the median, maximum, and minimum Pond Edge polygon area (m2)
Summary_AllPEA_year <- ddply(AllPondEdge_QuadFWing_Polygons,.(year),summarize,
Median_PEA = median(area_m2,na.rm = TRUE),
Max_PEA = max(area_m2,na.rm = TRUE),
Min_PEA = min(area_m2,na.rm = TRUE))
# summarize the water polygon area data collected with both the quadcopter and fixed wing UAS
# for each month within each year.
# calculate the mean and standard deviation polygon area (m2)
Summary_AllWA_monthyear <- ddply(AllWater_QuadFWing_Polygons,.(MonthYr),summarize,
Mean_WA = mean(area_m2,na.rm = TRUE),
STDev_WA = sd(area_m2,na.rm = TRUE))
######################################################################################
#summarize the water polygon area collected with the Quadcopter UAS by pond
# calculate median area (m2)
Summary_QWAbyPond <- ddply(Quad_Water_PondPolygons,.(Burkeetal2019_ID), summarize,
MedQWA_pond = median(area_m2,na.rm = TRUE))
# create a subset of the AllPondEdge_QuadFWing_Polygons matrix to include only
# flights that occured in the month of July
AllPondEdge_QuadFWing_Polygons_JulyOnly <- subset(AllPondEdge_QuadFWing_Polygons,
AllPondEdge_QuadFWing_Polygons$month == 7)
# In order to test the validity of including the FWing UAS imagery in time series
# analysis we calculated the average water polygon area and pond edge polygon
# area from Quadcopter UAS imagery for each pond across each sampling season.
# These values were then matched to the corresponding PondYr in the matrix
# containing only FWing UAS imagery. We calculated averages among Quadcopter
# imagery collected ONLY in July (since the FWing imagery was only collected in
# July) as well as across the entire field season.
# calculate the mean of the water polygon area from Quadcopter UAS imagery
# by the PondYr grouping indentifier
Summary_QuadArea_PYr <- ddply(Quad_Water_PondPolygons,.(PondYr), summarize,
Avg_WA_Quad = mean(area_m2, na.rm = TRUE))
# calculate the mean of the pond edge polygon area from Quadcopter UAS imagery
# by the PondYr grouping indentifier
Summary_QuadPEArea_Pyr <- ddply(Quad_PondEdge_PondPolygons,.(PondYr), summarize,
Avg_PEA_Quad = mean(area_m2, na.rm = TRUE))
# calculate a mean polygon area using the PondYr grouping identifier
Summary_QuadArea_JulyOnly_PYr <- ddply(Quad_Water_PondPolygons_JulyOnly,.(PondYr),
summarize,Avg_JulWA_Quad = mean(area_m2, na.rm = TRUE))
#subset the Quad_PondEdge_PondPolygons matrix to only containg data from the month of July
Quad_PondEdge_PondPolygons_JulyOnly <- subset(Quad_PondEdge_PondPolygons,
Quad_PondEdge_PondPolygons$month == 7)
# calculate a mean polygon area using the PondYr grouping identifier
Summary_QuadPEArea_JulyOnly_PYr <- ddply(Quad_PondEdge_PondPolygons_JulyOnly,.(PondYr),summarize,
Avg_JulPEA_Quad = mean(area_m2, na.rm = TRUE))
# Match the Avg area from July Only and all Quad to FWing_Water_PondPolygons by PondYr
FWing_Water_PondPolygons$Avg_WA_Quad <- Summary_QuadArea_PYr$Avg_WA_Quad[match(
FWing_Water_PondPolygons$PondYr,Summary_QuadArea_PYr$PondYr)]
FWing_Water_PondPolygons$Avg_JulWA_Quad <- Summary_QuadArea_JulyOnly_PYr$Avg_JulWA_Quad[
match(FWing_Water_PondPolygons$PondYr,Summary_QuadArea_JulyOnly_PYr$PondYr)]
# Match the Avg area from the whole field season and all Quad to FWing_Water_PondPolygons by PondYr
FWing_PondEdge_PondPolygons$Avg_PEA_Quad <- Summary_QuadPEArea_Pyr$Avg_PEA_Quad[match(
FWing_PondEdge_PondPolygons$PondYr,Summary_QuadPEArea_Pyr$PondYr)]
FWing_PondEdge_PondPolygons$Avg_JulPEA_Quad <- Summary_QuadPEArea_JulyOnly_PYr$Avg_JulPEA_Quad[
match(FWing_PondEdge_PondPolygons$PondYr,Summary_QuadPEArea_JulyOnly_PYr$PondYr)]
##
# calculate the median pond edge area from both Quadcopter and Fixed Wing UAS
# imagery by the grouping identifier PondYr
MedPEA_byPondYr <- ddply(AllPondEdge_QuadFWing_Polygons,.(PondYr), summarize,
MedPEA_pondyr = median(area_m2,na.rm = TRUE),
MedRatioPEA_pondyr = median(edge.area, na.rm = TRUE))
# match the cumulative bubble flux to the same PondYr in MedPEA_byPondYr
MedPEA_byPondYr$CumFlux <- AllPondEdge_QuadFWing_Polygons$Cumulative_BubFlux[match(MedPEA_byPondYr$PondYr,AllPondEdge_QuadFWing_Polygons$PondYr)]
# separate the group identifier back out into Burkeetal2019_ID and Year
MedPEA_byPondYr <- separate(MedPEA_byPondYr,col = PondYr, into = c("Burkeetal2019_ID","Year"), remove = TRUE)
#summarize the data in MedPEA_byPondYr (which had a separate median area for each field season)
# into a single median area (m2) across all three field seasons. Calculate also the 25% and 75% percentile,
# and the same thing for a median cumulative flux across all three field seasons.
Summary_MedPEA_MedCumFl_allyrs_allponds <- ddply(MedPEA_byPondYr,.(Burkeetal2019_ID),summarize,
MedPEA_byPond_allyrs = median(MedPEA_pondyr, na.rm = TRUE),
Quant25_PEA_allyrs = quantile(MedPEA_pondyr,.25,na.rm = TRUE),
Quant75_PEA_allyrs = quantile(MedPEA_pondyr,.75,na.rm = TRUE),
MedRatioPEA_byPond_allyrs = median(MedRatioPEA_pondyr, na.rm = TRUE),
Quant25_RatioPEA_allyrs = quantile(MedRatioPEA_pondyr,.25,na.rm = TRUE),
Quant75_RatioPEA_allyrs = quantile(MedRatioPEA_pondyr,.75,na.rm = TRUE),
MedCumFl_allyrs = median(CumFlux,na.rm = TRUE),
Quant25_CumFl_allyrs = quantile(CumFlux,.25,na.rm = TRUE),
Quant75_CumFl_allyrs = quantile(CumFlux,.75,na.rm = TRUE))
#######
## Colors for Plotting ############################################################
# for plotting each pond as a separate boxplot
# this matches the color scheme used in Burke et al. (2019)
# These colors were chosen with the help of the Colorbrewer website:
# https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3
Pondcolors = c(rgb(254,224,144,maxColorValue = 255),#D (A)
rgb(224,243,248,maxColorValue = 255),#E (B)
rgb(69,117,180,maxColorValue = 255), # S (C)
rgb(253,174,97,maxColorValue = 255),#C (D)
rgb(215,48,39, maxColorValue = 255),#A (E)
rgb(244,109,67,maxColorValue = 255),#B (F)
#rgb(171,217,233, maxColorValue = 255),#F (G)
rgb(116,173,209,maxColorValue = 255))#R (H)
# plotting each month separately
Monthcolors = c(rgb(237,248,251,maxColorValue = 255), #June
rgb(179,205,227, maxColorValue = 255), #July
rgb(140,150,198, maxColorValue = 255)) #August
# color pallets for plotting. Some ponds had no UAS imagery in particular years,
# which is why the pallets are separated here.
Pondcolors_201817 <-c(rgb(254,224,144,maxColorValue = 255),#D (A)
rgb(224,243,248,maxColorValue = 255),#E (B)
rgb(69,117,180,maxColorValue = 255), # S (C)
#rgb(253,174,97,maxColorValue = 255),#C (D)
rgb(215,48,39, maxColorValue = 255),#A (E)
rgb(244,109,67,maxColorValue = 255),#B (F)
#rgb(171,217,233, maxColorValue = 255),#F (G)
rgb(116,173,209,maxColorValue = 255))#R (H)
Pondcolors_2016 <-c(rgb(254,224,144,maxColorValue = 255),#D (A)
rgb(224,243,248,maxColorValue = 255),#E (B)
rgb(69,117,180,maxColorValue = 255), # S (C)
rgb(253,174,97,maxColorValue = 255),#C (D)
rgb(215,48,39, maxColorValue = 255),#A (E)
rgb(244,109,67,maxColorValue = 255),#B (F)
#rgb(171,217,233, maxColorValue = 255),#F (G)
rgb(116,173,209,maxColorValue = 255))#R (H)
#For plotting each year separately
SamplingSeasons_colors = c(
rgb(237,248,251, maxColorValue = 255), #2014
rgb(178,226,226, maxColorValue = 255), #2015
rgb(102,194,164, maxColorValue = 255), #2016
rgb(44,162,95, maxColorValue = 255), #2017
rgb(0,109,44, maxColorValue = 255)) # 2018
######
# create empty data frame to be used to calculate ratio of water area and pond edge area for each fligth date
# there are 163 unique FlightDatePond values
PondsFillUp <- data.frame(matrix(data=NA,nrow = 170,ncol = 1))
names(PondsFillUp) <- c("FlightDatePondUAS")
PondsFillUp$FlightDatePondUAS<- paste(unique(RSEdataframe_all$FlightDatePondUAS))
PondsFillUp <- separate(PondsFillUp,col = FlightDatePondUAS, into = c("FlightDate","Burkeetal2019_ID","UASType"), sep = " ", remove = FALSE)
PondsFillUp$FlightDate <- as.POSIXct(PondsFillUp$FlightDate,
format = "%Y-%m-%d", tz = "CET")
# create a column containing only the numerical month of each flight
PondsFillUp$month <- as.numeric(strftime(PondsFillUp$FlightDate,
"%m", tz = "CET"))
# create a column containing only the numerical year of each flight
PondsFillUp$year <- as.numeric(strftime(PondsFillUp$FlightDate,
"%Y", tz = "CET"))
PondsFillUp$PondEdge_area <- AllPondEdge_QuadFWing_Polygons$area_m2[match(PondsFillUp$FlightDatePondUAS, AllPondEdge_QuadFWing_Polygons$FlightDatePondUAS)]
PondsFillUp$Water_area <- AllWater_QuadFWing_Polygons$area_m2[match(PondsFillUp$FlightDatePondUAS, AllWater_QuadFWing_Polygons$FlightDatePondUAS)]
PondsFillUp$WPERatio_percent <- (PondsFillUp$Water_area/PondsFillUp$PondEdge_area)*100
PondsFillUp$TotPrec_8dpreflight <- RSEdataframe_all$TotPrec_8dpreflight[match(PondsFillUp$FlightDate,RSEdataframe_all$FlightDate)]
PondsFillUp$PondMoYr <- paste(PondsFillUp$Burkeetal2019_ID,PondsFillUp$month, PondsFillUp$year, sep= " ")
PondsFillUp_A <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="A")
PondsFillUp_B <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="B")
PondsFillUp_C <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="C")
PondsFillUp_D <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="D")
PondsFillUp_E <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="E")
PondsFillUp_F <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="F")
PondsFillUp_H <- subset(PondsFillUp,PondsFillUp$Burkeetal2019_ID =="H")
Summary_PondsFillUp <- ddply(PondsFillUp,.(PondMoYr), summarize,
Median_WPERatio = median(WPERatio_percent, na.rm = TRUE),
Quant25_WPERatio = quantile(WPERatio_percent,0.25, na.rm = TRUE),
Quant75_WPERatio = quantile(WPERatio_percent,0.75, na.rm = TRUE))
Summary_PondsFillUp <- separate(Summary_PondsFillUp, col = PondMoYr, into = c("Burkeetal2019_ID","month","year"), sep = " ", remove = FALSE)
Summary_PondsFillUp$MoYr <- paste(Summary_PondsFillUp$month, Summary_PondsFillUp$year, sep = " ")
Summary_PondsFillUp$MoYr_order <- ifelse(Summary_PondsFillUp$MoYr == "7 2014",2,
ifelse(Summary_PondsFillUp$MoYr == "7 2015",6,
ifelse(Summary_PondsFillUp$MoYr == "6 2016",9,
ifelse(Summary_PondsFillUp$MoYr == "7 2016",10,
ifelse(Summary_PondsFillUp$MoYr == "8 2016",11,
ifelse(Summary_PondsFillUp$MoYr == "6 2017",13,
ifelse(Summary_PondsFillUp$MoYr == "7 2017",14,
ifelse(Summary_PondsFillUp$MoYr == "8 2017",15,
ifelse(Summary_PondsFillUp$MoYr == "6 2018",17,
ifelse(Summary_PondsFillUp$MoYr == "7 2018",18,
ifelse(Summary_PondsFillUp$MoYr == "8 2018",19,NA)))))))))))
##Code for Plot creation and Statistics#######################################
# the code used for plot creation and related statistical analysis can be found
# below, any stats presented on particular plots can be found below each plot.
# Figure 3 #####
# Plot Description: This three panel plot shows Water Area (m^2) measured from
# both Quadcopter and Fixed Wing imagery by pond (panel A), Pond Depression Area measured from
# both Quadcopter and Fixed Wing imagery by pond (panel B), and the ratio between the two areas (panel C).
# Significant results from the Kruskal-Wallis Ranks Sum test (H, d.f, p)
# is displayed at the top of each figure figure. Lowercase letters above the boxplots
# represent significant pairwise differences between ponds and pond types. Numbers
# below the x-axis represent the number of images included below panels A and B.
## save the plot
#pdf("Figure03.pdf",width= 11, height = 8.5)
plot.new()
par(mfrow=c(1,3))
#A.)
# set the dimensions of the top plot
par(mar = c(2.5,4,1,0.5))
par(fig=c(0,1,.68,1), new=TRUE,oma = c(1,1,1,0), cex.axis = 1)
boxplot(area_m2~Burkeetal2019_ID, data = AllWater_QuadFWing_Polygons, col=Pondcolors,
ylim = c(0,400),ylab = " ", xlab = " ", outpch = 16, axes = FALSE)
axis(1, at = c(1,2,3,4,5,6,7),lab = c("A","B","C","D","E","F","H"), cex.axis = 1.25)
axis(2,at = c(0,100,200,300,400,500,600),las =2,cex.axis=1.25)
mtext(side = 3, expression (bold("A.)")), at = -0.25, line = 0, cex = 1)
text(7.25, 400, expression("H = 127.56"), cex = 1.25)
text(7.25, 370, expression("d.f. = 6"), cex = 1.25)
text(7.25, 340, expression(italic("p")~"< 0.0001"), cex = 1.25)
text(1, 365, expression("a"), cex =1.25) # pond A
text(2, 110, expression("b"), cex =1.25) # pond B
text(3, 85, expression("c"), cex = 1.25) # pond C
text(4, 195, expression("cd"), cex = 1.25) # pond D
text(5, 205, expression("a"), cex = 1.25) # pond E
text(6, 163, expression("d"), cex = 1.25) # pond F
text(7, 285, expression("e"), cex = 1.25) # pond H
mtext(side = 1, expression(bolditalic("n = ")), line = 2.25, outer = FALSE,
at = 0.25, cex = .75 )
mtext(side = 1, expression(bolditalic("25")), line = 2.25, outer = FALSE, at = 1,
cex = .75)
mtext(side = 1, expression(bolditalic("24")), line = 2.25, outer = FALSE, at = 2,
cex = .75)
mtext(side = 1, expression(bolditalic("28")), line = 2.25, outer = FALSE, at = 3,
cex = .75)
mtext(side = 1, expression(bolditalic("20")), line = 2.25, outer = FALSE, at = 4,
cex = .75)
mtext(side = 1, expression(bolditalic("24")), line = 2.25, outer = FALSE, at = 5,
cex = .75)
mtext(side = 1, expression(bolditalic("24")), line = 2.25, outer = FALSE, at = 6,
cex = .75)
mtext(side = 1, expression(bolditalic("25")), line = 2.25, outer = FALSE, at = 7,
cex = .75)
mtext(side = 2,expression("Water Area ("*~m^{2}*")"),line = 3,
outer = FALSE, cex = 1)
box(lty =1)
#
# Use the kruskal function to perform a Kruskal-Wallis test, providing a H
# statistic and a p-value, as well as perform a multiple pairwise comparison
# and provide the final lower case letters signifying significant differences.
kruskal(AllWater_QuadFWing_Polygons$area_m2,AllWater_QuadFWing_Polygons$Burkeetal2019_ID,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# I used the kruskal.test() function to double check what the p value of the test
# is given the kruskal() function cannot approximate very significant p values
kruskal.test(area_m2~Burkeetal2019_ID, data = AllWater_QuadFWing_Polygons)
# Given the above test reports the same H and df values as krusal() I will list
# the p value of this test as <0.0001
# set the dimensions of the middle plot
par(mar = c(2.5,4,1,0.5))
#par(mar = c(5,5,4,1))
#
par(fig=c(0,1,.35,.65),new = TRUE,oma = c(1,1,1,0), cex.axis = 1)
boxplot(area_m2~Burkeetal2019_ID, data = AllPondEdge_QuadFWing_Polygons,
col=Pondcolors,ylim = c(0,575),ylab = " ", xlab = " ", outpch = 16,
axes = FALSE)
# customize the bottom x axis
axis(1,at = c(1,2,3,4,5,6,7), lab = c("A","B","C","D","E","F","H"), cex.axis = 1.25)
# customize the left y axis
axis(2,at = c(0,100,200,300,400,500,600),las =2, cex.axis= 1.25)
# label the subplot
mtext(side = 3, expression (bold("B.)")), at = -0.25, line = 0, cex = 1)
# add the H statistic to the plot
text(7.25, 560, expression("H = 151.68"), cex = 1.25)
# add the df to the plot
text(7.25, 520, expression("d.f. = 6"), cex = 1.25)
# add the p value to the plot
text(7.25, 480, expression(italic("p")~"< 0.0001"), cex = 1.25)
# add the lowercase letters that represent pairwise comparisions to above their
# respective boxplots (see kruskal() call below)
text(1, 225, expression("a"), cex =1.25) # Pond A
text(2, 90, expression("b"), cex =1.25) # Pond B
text(3, 85, expression("c"), cex = 1.25) # Pond C
text(4, 560, expression("d"), cex = 1.25) # Pond D
text(5, 190, expression("e"), cex = 1.25) # Pond E
text(6, 160, expression("e"), cex = 1.25) # Pond F
text(7, 245, expression("f"), cex = 1.25)# Pond H
# add the number of images represented by each boxplot below the x axis label
mtext(side = 1, expression(bolditalic("n = ")), line = 2.25, outer = FALSE,
at = 0.25, cex = .75 )
mtext(side = 1, expression(bolditalic("25")), line = 2.25, outer = FALSE, at = 1,
cex = .75)
mtext(side = 1, expression(bolditalic("24")), line = 2.25, outer = FALSE, at = 2,
cex = .75)
mtext(side = 1, expression(bolditalic("28")), line = 2.25, outer = FALSE, at = 3,
cex = .75)
mtext(side = 1, expression(bolditalic("17")), line = 2.25, outer = FALSE, at = 4,
cex = .75)
mtext(side = 1, expression(bolditalic("24")), line = 2.25, outer = FALSE, at = 5,
cex = .75)
mtext(side = 1, expression(bolditalic("24")), line = 2.25, outer = FALSE, at = 6,
cex = .75)
mtext(side = 1, expression(bolditalic("25")), line = 2.25, outer = FALSE, at = 7,
cex = .75)
# label the y axis
mtext(side = 2,expression("Pond Depression Area ("*~m^{2}*")"),line = 3,outer = FALSE,
cex = 1)
# add a black boarder around the plot
box(lty =1)
kruskal(AllPondEdge_QuadFWing_Polygons$area_m2,AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
kruskal.test(AllPondEdge_QuadFWing_Polygons$area_m2,AllPondEdge_QuadFWing_Polygons$Burkeetal2019_ID)
# Given the above test reports the same H and df values as krusal() I will list
# the p value of this test as <0.0001
# set the dimensions of the bottom plot
par(mar = c(3.5,4,1,0.5))
par(fig=c(0,1,0,.32), new=TRUE,oma = c(1,1,1,0), cex.axis = 1)
boxplot(PondsFillUp$WPERatio_percent~PondsFillUp$Burkeetal2019_ID,
col = Pondcolors, ylab = " ", xlab = " ", ylim = c(0,178), axes= FALSE)
mtext(side = 3, expression (bold("C.)")), at = -0.25, line = 0, cex = 1)
mtext(side = 2,expression("Ratio of Water Area" ),line = 3.75,outer = FALSE,
cex = 1)
mtext(side = 2,expression("to Pond Depression Area (%)" ),line = 2.5,outer = FALSE,
cex = 1)
axis(2, at = c(0,50,100,150), las = 2, cex.axis = 1.25)
axis(1,at = c(1,2,3,4,5,6,7), lab = c("A","B","C","D","E","F","H"), cex.axis = 1.25)
mtext(side = 1, expression("Pond"), line = 3.5, outer = FALSE, cex = 1)
kruskal(PondsFillUp$WPERatio_percent,PondsFillUp$Burkeetal2019_ID,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
text(1, 178, expression("ab"), cex =1.25) # Pond A
text(2, 120, expression("c"), cex =1.25) # Pond B
text(3, 117, expression("ab"), cex = 1.25) # Pond C
text(4, 60, expression("d"), cex = 1.25) # Pond D
text(5, 130, expression("a"), cex = 1.25) # Pond E
text(6, 135, expression("bc"), cex = 1.25) # Pond F
text(7, 130, expression("a"), cex = 1.25)# Pond H
text(7.25, 175, expression("H = 76.97"), cex = 1.25)
# add the df to the plot
text(7.25, 165, expression("d.f. = 6"), cex = 1.25)
# add the p value to the plot
text(7.25, 150, expression(italic("p")~"< 0.0001"), cex = 1.25)
box(lty =1)
abline(h=100, lty = 2)
#
# # #####
#Figure 4 ##########################################
#Plot Description: This figure shows the water area (m2) measured from both quadcopter and fixed wing imagery
# during June, July and August in 2016, 2017 and 2018 as the top plot.The months are represented by different colors. The number of
# individual polygons represented in each boxplot are displayed below the x axis
# label.Then below the top plot, three plots show Water Area for each month separated out by year.
## save the plot
#pdf("Figure04.pdf",width= 11, height = 8.5)
par(mfrow =c(1,1))
plot.new()
par(fig=c(0.25,0.75,0.5,0.98), new=TRUE,mar = c(4.5,5,0,0), oma = c(1,1,1,1),
cex.axis = 1)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons,
col = Monthcolors, axes = FALSE, ylab = " ", xlab = " ",ylim = c(0,400),
outpch = 16)
mtext(side = 2,expression("Water Area ("*~m^{2}*")"),line = 4,
outer = FALSE, cex = 1.5)
#mtext(side = 2, expression(italic("from Quadcopter and Fixed Wing Imagery")), line = 3, outer = FALSE, cex = 1.25)
#mtext(side = 1,expression("Month"), line = 5,outer = FALSE,cex = 1.5)
axis(1, at = c(1,2,3), lab = c("June","July","August"), cex.axis= 1.25)
#mtext(side = 3, expression("A.)"), line = 1, at = 0, outer = FALSE, cex=1.5)
axis(2,at = c(0,100,200,300,400,500,600), las = 2, cex.axis=1.25)
mtext(side = 1, expression(bolditalic("n = ")), line = 3, outer = FALSE,
at = 0.25, cex = 1.25 )
mtext(side = 1, expression(bolditalic("52")), line = 3, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("100")), line = 3, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("18")), line = 3, outer = FALSE, at = 3,
cex = 1.25)
mtext(side = 3, expression("2014 - 2018"), line = 0.5, at = 2, outer = FALSE, cex=1.5)
box(lty = 1)
kruskal(AllWater_QuadFWing_Polygons$area_m2,AllWater_QuadFWing_Polygons$month,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
AllWater_QuadFWing_Polygons_2016 <- subset(AllWater_QuadFWing_Polygons,AllWater_QuadFWing_Polygons$year == '2016')
AllWater_QuadFWing_Polygons_2017 <- subset(AllWater_QuadFWing_Polygons,AllWater_QuadFWing_Polygons$year == '2017')
AllWater_QuadFWing_Polygons_2018 <- subset(AllWater_QuadFWing_Polygons,AllWater_QuadFWing_Polygons$year == '2018')
par(mfrow =c(1,1))
#plot.new()
par(fig=c(0,.35,0,0.5), new=TRUE,mar = c(6,5,2,0), oma = c(1,1,1,1),
cex.axis = 1)
#A.)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons_2016,
col = Monthcolors, axes = FALSE, ylab = " ", xlab = " ",ylim = c(0,400),
outpch = 16)
mtext(side = 2,expression("Water Area ("*~m^{2}*")"),line = 4,
outer = FALSE, cex = 1.5)
#mtext(side = 2, expression(italic("from Quadcopter and Fixed Wing Imagery")), line = 3, outer = FALSE, cex = 1.25)
axis(1, at = c(1,2,3), lab = c("June","July","August"), cex.axis= 1.25)
mtext(side = 3, expression("2016"), line = 0.5, at = 2, outer = FALSE, cex=1.5)
axis(2,at = c(0,100,200,300,400,500,600), las = 2, cex.axis=1.25)
sum(AllWater_QuadFWing_Polygons_2016$month == "6")
sum(AllWater_QuadFWing_Polygons_2016$month == "7")
sum(AllWater_QuadFWing_Polygons_2016$month == "8")
mtext(side = 1, expression(bolditalic("n = ")), line = 3, outer = FALSE,
at = 0.25, cex = 1.25 )
mtext(side = 1, expression(bolditalic("32")), line = 3, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("48")), line = 3, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("7")), line = 3, outer = FALSE, at = 3,
cex = 1.25)
box(lty = 1)
kruskal(AllWater_QuadFWing_Polygons_2016$area_m2,
AllWater_QuadFWing_Polygons_2016$month,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# not significant
par(fig=c(0.33,.67,0,0.5), new=TRUE,mar = c(6,5,2,0), oma = c(1,1,1,1),
cex.axis = 1)
#B.)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons_2017,
col = Monthcolors, axes = FALSE, ylab = " ", xlab = " ",ylim = c(0,400),
outpch = 16)
mtext(side = 1,expression("Month"), line = 5, at = 1.5 , outer = FALSE,cex = 1.5)
axis(1, at = c(1,2,3), lab = c("June","July","August"), cex.axis= 1.25)
mtext(side = 3, expression("2017"), line = 0.5, at = 1.5, outer = FALSE, cex=1.5)
axis(2,at = c(0,100,200,300,400,500,600), las = 2, cex.axis=1.25)
sum(AllWater_QuadFWing_Polygons_2017$month == "6")
sum(AllWater_QuadFWing_Polygons_2017$month == "7")
sum(AllWater_QuadFWing_Polygons_2017$month == "8") ## No imagery collected in August 2017
mtext(side = 1, expression(bolditalic("6")), line = 3, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("16")), line = 3, outer = FALSE, at = 2,
cex = 1.25)
box(lty = 1)
kruskal(AllWater_QuadFWing_Polygons_2017$area_m2,
AllWater_QuadFWing_Polygons_2017$month,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# not significant
par(fig=c(0.65,1,0,0.5), new=TRUE,mar = c(6,5,2,0), oma = c(1,1,1,1),
cex.axis = 1)
#C.)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons_2018,
col = Monthcolors, axes = FALSE, ylab = " ", xlab = " ",ylim = c(0,400),
outpch = 16)
axis(1, at = c(1,2,3), lab = c("June","July","August"), cex.axis= 1.25)
mtext(side = 3, expression("2018"), line = 1, at = 2, outer = FALSE, cex=1.5)
axis(2,at = c(0,100,200,300,400,500,600), las = 2, cex.axis=1.25)
sum(AllWater_QuadFWing_Polygons_2018$month == "6")
sum(AllWater_QuadFWing_Polygons_2018$month == "7")
sum(AllWater_QuadFWing_Polygons_2018$month == "8")
mtext(side = 1, expression(bolditalic("14")), line = 3, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("24")), line = 3, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("11")), line = 3, outer = FALSE, at = 3,
cex = 1.25)
box(lty = 1)
kruskal(AllWater_QuadFWing_Polygons_2018$area_m2,
AllWater_QuadFWing_Polygons_2018$month,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# not significant
# Figure 5########################################################################
# Plot Description: This plot shows Pond Depression Polygon Area (m^2)
# by sampling season with a all ponds plotted together measured from both Quadcopter and Fixed Wing imagery.
# The sampling seasons are represented by different colors. The number of
# individual polygons represented in each boxplot are displayed below year x axis
# label.
#
## save the plot
#pdf("Figure05.pdf",width= 11, height = 8.5)
par(mfrow = c(1,1))
plot.new()
par(mar = c(4,4.75,1,0))
par(fig=c(0,0.48,0,1), new=TRUE,oma = c(1,1,1,0), cex.axis = 1)
#A.)
boxplot(area_m2~year, data = AllPondEdge_QuadFWing_Polygons,
col = SamplingSeasons_colors, ylim = c(0,600), axes = FALSE,
ylab = " ",xlab = " ",outpch = 16)
mtext(side = 1, expression ("Year"), line = 4, cex = 1.5, at = 6)
mtext(side = 2, expression ("Pond Depression Area ("*~m^{2}*")"), line = 4,
cex = 1.5)
#mtext(side = 2, expression(italic("from Quadcopter and Fixed Wing Imagery")), line = 3 ,
# cex = 1.25)
mtext(side = 3, expression("A.)"), cex = 1.5, line=0, at = -1)
axis(1, at = c(1,2,3,4,5), lab = c("2014","2015","2016","2017","2018"),
cex.axis = 1.25)
axis(2,at = c(0,100,200,300,400,500,600), las = 2, cex.axis=1.25)
mtext(side = 1, expression(bolditalic("n = ")), line = 2.5, outer = FALSE,
at = 0.25, cex = 1.25)
mtext(side = 1, expression(bolditalic("6")), line = 2.5, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("6")), line = 2.5, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("84")), line = 2.5, outer = FALSE, at = 3,
cex = 1.25)
mtext(side = 1, expression(bolditalic("22")), line = 2.5, outer = FALSE, at = 4,
cex = 1.25)
mtext(side = 1, expression(bolditalic("49")), line = 2.5, outer = FALSE, at = 5,
cex = 1.25)
box(lty = 1, lwd =1)
# #
kruskal(AllPondEdge_QuadFWing_Polygons$area_m2,
AllPondEdge_QuadFWing_Polygons$year,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# not significant
par(mar = c(4,4,1,0.5))
par(fig=c(0.52,1,0,1), new=TRUE,oma = c(1,1,1,0), cex.axis = 1)
#A.)
boxplot(area_m2~year, data = AllWater_QuadFWing_Polygons,
col = SamplingSeasons_colors, ylim = c(0,600), axes = FALSE,
ylab = " ",xlab = " ",outpch = 16)
#mtext(side = 1, expression ("Year"), line = 4, cex = 1.5)
mtext(side = 2, expression ("Water Area ("*~m^{2}*")"), line = 4,
cex = 1.5)
#mtext(side = 2, expression(italic("from Quadcopter and Fixed Wing Imagery")), line = 3 ,
# cex = 1.25)
mtext(side = 3, expression("B.)"), cex = 1.5, line=0, at = -1)
axis(1, at = c(1,2,3,4,5), lab = c("2014","2015","2016","2017","2018"),
cex.axis = 1.25)
axis(2,at = c(0,100,200,300,400,500,600), las = 2, cex.axis=1.25)
mtext(side = 1, expression(bolditalic("n = ")), line = 2.5, outer = FALSE,
at = 0.25, cex = 1.25)
mtext(side = 1, expression(bolditalic("6")), line = 2.5, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("6")), line = 2.5, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("87")), line = 2.5, outer = FALSE, at = 3,
cex = 1.25)
mtext(side = 1, expression(bolditalic("22")), line = 2.5, outer = FALSE, at = 4,
cex = 1.25)
mtext(side = 1, expression(bolditalic("49")), line = 2.5, outer = FALSE, at = 5,
cex = 1.25)
box(lty = 1, lwd =1)
# #
kruskal(AllWater_QuadFWing_Polygons$area_m2,
AllWater_QuadFWing_Polygons$year,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# not significant
########################################################################################
# NOTE: Code to produce Supplementary Figure S1 can be found in the
# Burkeetal_RSEManuscript_SupplementalFluxCalculations.R Script.
# Supplementary Figure S3#######################################################
# Plot Description: Two panel plot with the left panel (A.) plotting the
# Average Pond Depression Area (m^2) measured from Quadcopter imagery (y axis)
# versus Pond Depression Area (m^2) measured from Fixed Wing Imagery (x axis).
# There is a inset plot in panel A that is the same as the larger Panel A plot
# except that the y axis is an average of Pond Edge Area from Quadcopter imagery
# collected only in July. Panel B shows average Water area of Quadcopter Imagery
# (y axis) vs. Water Area (m^2) measured from the Fixed Wing Imagery with a inset
# plot in panel B that is the same as the larger Panel B plot except that the
# y axis is an average of Pond Edge Area from Quadcopter imagery collected only
# in July. Each pond is represented by different colors and each sampling season
#(2016-2018) are represented by different shapes. The y axis is an average while
# the x axis is not because the Quadcopter was flown multiple times each year,
# while the Fixed Wing drone was flown only once per year. At the top of
# both plots is the tau value and p value from a Kendall Test. A 1:1 line is also
# plotted on both plots (and inset plots) with the 1:1 line in the larger plots
# slightly offset in order to accommodate the inset plots.
#
## save the plot
#pdf("FigureS03.pdf",width= 11, height = 8.5)
# A.)
plot.new()
par(mar=c(8,8,8,8))
par(fig = c(0.02,.52,0,1), new = TRUE,mar = c(7,4,1,1),oma = c(1,1,1,1), cex.axis=1)
plot(Avg_PEA_Quad~area_m2, data = FWing_PondEdge_PondPolygons,
subset = FWing_PondEdge_PondPolygons$year == 2018,xlim = c(0,325),
ylim =c(0,275),
pch = 21,col = "black", bg= Pondcolors_201817, axes = FALSE,cex =2,
ylab =" ",xlab = " ")
abline(0,1,lty = 1)
text(255,273, expression("1:1"), cex = 1.25)
mtext(side = 3, expression("A.)"), cex = 1.5, line=0, at = -40)
mtext(side = 2,expression("Average Pond Depression Area " (m^2)),
cex = 1.5, line = 3.5)
mtext(side = 2,expression(italic("from Quadcopter Imagery")),
cex = 1.25, line = 2.5)
mtext(side = 1,expression("Pond Depression Area " (m^2)),line = 3,
cex = 1.5)
mtext(side = 1, expression(italic("from Fixed Wing Imagery")), line = 4, cex = 1.25)
axis(1,at = c(50,100,150,200,250), cex.axis= 1.25)
axis(2,at = c(50,100,150,200,250), las= 2,cex.axis= 1.25)
points(Avg_PEA_Quad~area_m2, data = FWing_PondEdge_PondPolygons,
subset = FWing_PondEdge_PondPolygons$year == 2017,cex =2,xlim = c(0,300),
ylim = c(0,300),pch = 22, col = "black", bg = Pondcolors_201817)
points(Avg_PEA_Quad~area_m2, data = FWing_PondEdge_PondPolygons,
subset = FWing_PondEdge_PondPolygons$year == 2016,cex=2, xlim = c(0,300),
ylim = c(0,300), pch = 23, col = "black", bg = Pondcolors_2016)
box(lty =1 )
text(90,275, expression(tau~"= 0.90"),cex = 1.25)
text(180,275, expression(italic("p")~"< 0.0001"), cex = 1.25)
# A Kendall Correlation is performed to look at significat relationships among
# continuous variables.
cor.test(FWing_PondEdge_PondPolygons$area_m2,
FWing_PondEdge_PondPolygons$Avg_PEA_Quad,method = "kendall")
# strong correlation
#
# inset plot for Panel A
par(fig = c(0.25,0.49,0.06,0.6), new = TRUE,mar = c(7,4,1,0),oma = c(1,1,1,1), cex.axis=1)
plot(Avg_JulPEA_Quad~area_m2, data = FWing_PondEdge_PondPolygons,
subset = FWing_PondEdge_PondPolygons$year == 2018,xlim = c(0,275),
ylim =c(0,275),
pch = 21,col = "black", bg= Pondcolors_201817, axes = FALSE, ylab =" ",
xlab = " ", cex = 2)
abline(0,1,lty = 1)
text(245,273, expression("1:1"), cex = 1.25)
mtext(side = 3,expression("July Only"), cex = 1.25, line = 0)
axis(1,at = c(50,150,250),cex.axis= 1.25)
axis(2,at = c(50,100,150,200,250), las= 2,cex.axis= 1.25)
points(Avg_JulPEA_Quad~area_m2, data = FWing_PondEdge_PondPolygons,
subset = FWing_PondEdge_PondPolygons$year == 2017,cex = 2,
xlim = c(0,300),ylim = c(0,300),pch = 22, col = "black",
bg = Pondcolors_201817)
points(Avg_JulPEA_Quad~area_m2, data = FWing_PondEdge_PondPolygons,
subset = FWing_PondEdge_PondPolygons$year == 2016,cex = 2,
xlim = c(0,300), ylim = c(0,300), pch = 23, col = "black",
bg = Pondcolors_2016)
box(lty =1 )
text(90,260, expression(tau~"= 0.91"),cex = 1.25)
text(90,230, expression(italic("p")~"< 0.0001"), cex = 1.25)
# strong correlation
cor.test(FWing_PondEdge_PondPolygons$area_m2,
FWing_PondEdge_PondPolygons$Avg_JulPEA_Quad,method = "kendall")
#
# create a custom legend for the plot
par(fig = c(0, 1, 0, 1), oma = c(0, 0, 0, 0), mar = c(0, 0, 0, 0), new = TRUE)
plot(0, 0, type = "n", bty = "n", xaxt = "n", yaxt = "n")
legend(-0.7,-0.95, c("A","B","C","D","E","F","H"), xpd = TRUE, horiz = TRUE,
inset = c(0,0), bty = "n", pch = c(NA,NA,NA,NA,NA,NA,NA), col = "black",
fill = Pondcolors, cex = 1.25)
par(fig = c(0, 1, 0, 1), oma = c(0, 0, 0, 0), mar = c(0, 0, 0, 0), new = TRUE)
plot(0, 0, type = "n", bty = "n", xaxt = "n", yaxt = "n")
legend(.3,-0.95, c("2016","2017","2018"), xpd = TRUE, horiz = TRUE,
inset = c(0,0), bty = "n", pch = c(23,22,21), col = "black",cex = 1.25)
#
#B.)
par(fig = c(0.52,1,0,1), new = TRUE,mar = c(7,5,1,0),oma = c(1,1,1,1), cex.axis=1)
plot(Avg_WA_Quad~area_m2, data = FWing_Water_PondPolygons,
subset = FWing_Water_PondPolygons$year == 2018,xlim = c(0,325),
ylim =c(0,275),
pch = 21,col = "black", bg= Pondcolors_201817, axes = FALSE,cex =2,
ylab =" ",xlab = " ")
abline(0,1,lty = 1)
text(255,273, expression("1:1"), cex = 1.25)
mtext(side = 3, expression("B.)"), cex = 1.5, line=0, at = -40)
mtext(side = 2,expression("Average Water Area " (m^2)),
cex = 1.5, line = 3.5)
mtext(side = 2, expression(italic("from Quadcopter Imagery")), cex= 1.25,
line = 2.5)
mtext(side = 1,expression("Water Area " (m^2)),line = 3,
cex = 1.5)
mtext(side = 1, expression(italic("from Fixed Wing Imagery")), line = 4, cex =1.25)
axis(1,at = c(50,100,150,200,250),cex.axis= 1.25)
axis(2,at = c(50,100,150,200,250), las= 2,cex.axis= 1.25)
points(Avg_WA_Quad~area_m2, data = FWing_Water_PondPolygons,
subset = FWing_Water_PondPolygons$year == 2017,cex =2,xlim = c(0,300),
ylim = c(0,300),pch = 22, col = "black", bg = Pondcolors_201817)
points(Avg_WA_Quad~area_m2, data = FWing_Water_PondPolygons,
subset = FWing_Water_PondPolygons$year == 2016,cex=2,xlim = c(0,300),
ylim = c(0,300), pch = 23, col = "black", bg = Pondcolors_2016)
box(lty =1 )
text(90,275, expression(tau~"= 0.78"),cex = 1.25)
text(180,275, expression(italic("p")~"< 0.0001"), cex = 1.25)
# strong correlation
cor.test(FWing_Water_PondPolygons$area_m2,
FWing_Water_PondPolygons$Avg_WA_Quad,method = "kendall")
#
# inset plot in Panel B.
par(fig = c(0.73,1,0.11,0.58), new = TRUE,mar = c(5,5,.25,1),oma = c(1,1,1,1),
cex.axis=1)
plot(Avg_JulWA_Quad~area_m2, data = FWing_Water_PondPolygons,
subset = FWing_Water_PondPolygons$year == 2018,xlim = c(0,275),
ylim =c(0,275),pch = 21,col = "black", bg= Pondcolors_201817,
axes = FALSE, ylab =" ",xlab = " ", cex = 2)
abline(0,1,lty = 1)
text(245,273, expression("1:1"), cex = 1.25)
mtext(side = 3, expression("July Only"), cex = 1.25)
axis(1,at = c(50,150,250),cex.axis= 1.25)
axis(2,at = c(50,100,150,200,250), las= 2,cex.axis= 1.25)
points(Avg_JulWA_Quad~area_m2, data = FWing_Water_PondPolygons,
subset = FWing_Water_PondPolygons$year == 2017,cex = 2,
xlim = c(0,300),ylim = c(0,300),pch = 22, col = "black",
bg = Pondcolors_201817)
points(Avg_JulWA_Quad~area_m2, data = FWing_Water_PondPolygons,
subset = FWing_Water_PondPolygons$year == 2016,cex = 2,
xlim = c(0,300), ylim = c(0,300), pch = 23, col = "black",
bg = Pondcolors_2016)
box(lty =1 )
text(90,260, expression(tau~"= 0.84"),cex = 1.25)
text(90,230, expression(italic("p")~"< 0.0001"), cex = 1.25)
# strong correlation
cor.test(FWing_Water_PondPolygons$area_m2,
FWing_Water_PondPolygons$Avg_WA_Quad,method = "kendall")
#dev.off()
######
# Supplementary Figure S4#####################################################################
# Plot Description: This figure is an expansion on Figure S4. Each pond is
# plotted separately with boxplots of the area of Water Polygons (m^2) measured
# from Quadcopter imagery AND Fixed Wing Images broken down by month. Ponds with significant differences
# in Water Polygon Area by month have a * by their names. The H statistic, d.f.
# and p values are also plotted (resulting from a Kruskal Wallis Test).
## save the plot
#pdf("FigureS04.pdf",width= 11, height = 8.5)
#
par(mfrow =c(1,1))
plot.new()
# Pond A
par(fig=c(.125,.375,.55,1), new=TRUE,mar = c(3,4,2,0), oma = c(1,1,1,1),
cex.axis = 1)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons,
subset = AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "A",
col = Monthcolors, ylab = " ", xlab = " ", ylim = c(0,420),
axes = FALSE, outpch = 16)
mtext(side = 3, expression ("Pond A*"), cex = 1.5)
axis(1,at =c(1,2,3), lab = c("June","July","August"),cex.axis= 1.25)
axis(2,at = c(0,100,200,300,400), las = 2,cex.axis= 1.25)
mtext(side = 1, expression(bolditalic("n = ")), line = 2.25, outer = FALSE,
at = 0.25, cex = 1.25 )
mtext(side = 1, expression(bolditalic("7")), line = 2.25, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("15")), line = 2.25, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("3")), line = 2.25, outer = FALSE, at = 3,
cex = 1.25)
text(1,410, expression("H = 6.49"), cex = 1.25)
text(2,410,expression("2 d.f."), cex= 1.25)
text(3,410, expression(italic("p")~"= 0.04"), cex = 1.26)
text(1,370, expression("a"), cex = 1.25)
text(2,310, expression("ab"), cex = 1.25)
text(3,330, expression("ab"), cex = 1.25)
box(lty = 1)
#
kruskal(AllWater_QuadFWing_Polygons_PondA$area_m2,
AllWater_QuadFWing_Polygons_PondA$month,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
# significant
#Pond B
par(fig=c(.375,.625,.55,1), new=TRUE,mar = c(3,4,2,0), oma = c(1,1,1,1),
cex.axis = 1)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons,
subset = AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "B",
col = Monthcolors, ylab = " ", xlab = " ", ylim = c(0,100),
axes = FALSE, outpch = 16)
mtext(side = 3, expression ("Pond B"), cex = 1.5)
mtext(side = 1, expression(bolditalic("7")), line = 2.25, outer = FALSE, at = 1,
cex = 1.25)
mtext(side = 1, expression(bolditalic("15")), line = 2.25, outer = FALSE, at = 2,
cex = 1.25)
mtext(side = 1, expression(bolditalic("2")), line = 2.25, outer = FALSE, at = 3,
cex = 1.25)
axis(1,at =c(1,2,3), lab = c("June","July","August"),cex.axis= 1.25)
axis(2,at = c(0,25,50,75,100),las = 2,cex.axis= 1.25)
box(lty = 1, lwd =1)
#
kruskal(AllWater_QuadFWing_Polygons_PondB$area_m2,
AllWater_QuadFWing_Polygons_PondB$month,
alpha = 0.05, p.adj = c("bonferroni"), group = TRUE, console = TRUE)
#not significant
# Pond C
par(fig=c(.625,.875,.55,1), new=TRUE,mar = c(3,4,2,0), oma = c(1,1,1,1),
cex.axis = 1)
boxplot(area_m2~month, data = AllWater_QuadFWing_Polygons,
subset = AllWater_QuadFWing_Polygons$Burkeetal2019_ID == "C",