forked from MSE-NCCOS-NOAA/NCRMP_benthics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NCRMP_benthics_vignette.html
1139 lines (1104 loc) · 136 KB
/
NCRMP_benthics_vignette.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Sarah Groves, Bethany Williams, Shay Viehman" />
<meta name="date" content="2024-03-04" />
<title>NCRMP Benthics statistical package in R</title>
<script src="data:application/javascript;base64,Ly8gUGFuZG9jIDIuOSBhZGRzIGF0dHJpYnV0ZXMgb24gYm90aCBoZWFkZXIgYW5kIGRpdi4gV2UgcmVtb3ZlIHRoZSBmb3JtZXIgKHRvCi8vIGJlIGNvbXBhdGlibGUgd2l0aCB0aGUgYmVoYXZpb3Igb2YgUGFuZG9jIDwgMi44KS4KZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIGZ1bmN0aW9uKGUpIHsKICB2YXIgaHMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCJkaXYuc2VjdGlvbltjbGFzcyo9J2xldmVsJ10gPiA6Zmlyc3QtY2hpbGQiKTsKICB2YXIgaSwgaCwgYTsKICBmb3IgKGkgPSAwOyBpIDwgaHMubGVuZ3RoOyBpKyspIHsKICAgIGggPSBoc1tpXTsKICAgIGlmICghL15oWzEtNl0kL2kudGVzdChoLnRhZ05hbWUpKSBjb250aW51ZTsgIC8vIGl0IHNob3VsZCBiZSBhIGhlYWRlciBoMS1oNgogICAgYSA9IGguYXR0cmlidXRlczsKICAgIHdoaWxlIChhLmxlbmd0aCA+IDApIGgucmVtb3ZlQXR0cmlidXRlKGFbMF0ubmFtZSk7CiAgfQp9KTsK"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<link rel="stylesheet" href="data:text/css,body%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Amargin%3A%201em%20auto%3B%0Amax%2Dwidth%3A%20700px%3B%0Aoverflow%3A%20visible%3B%0Apadding%2Dleft%3A%202em%3B%0Apadding%2Dright%3A%202em%3B%0Afont%2Dfamily%3A%20%22Open%20Sans%22%2C%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20Arial%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2014px%3B%0Aline%2Dheight%3A%201%2E35%3B%0A%7D%0A%23TOC%20%7B%0Aclear%3A%20both%3B%0Amargin%3A%200%200%2010px%2010px%3B%0Apadding%3A%204px%3B%0Awidth%3A%20400px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Aborder%2Dradius%3A%205px%3B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Afont%2Dsize%3A%2013px%3B%0Aline%2Dheight%3A%201%2E3%3B%0A%7D%0A%23TOC%20%2Etoctitle%20%7B%0Afont%2Dweight%3A%20bold%3B%0Afont%2Dsize%3A%2015px%3B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%23TOC%20ul%20%7B%0Apadding%2Dleft%3A%2040px%3B%0Amargin%2Dleft%3A%20%2D1%2E5em%3B%0Amargin%2Dtop%3A%205px%3B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%23TOC%20ul%20ul%20%7B%0Amargin%2Dleft%3A%20%2D2em%3B%0A%7D%0A%23TOC%20li%20%7B%0Aline%2Dheight%3A%2016px%3B%0A%7D%0Atable%20%7B%0Amargin%3A%201em%20auto%3B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dcolor%3A%20%23DDDDDD%3B%0Aborder%2Dstyle%3A%20outset%3B%0Aborder%2Dcollapse%3A%20collapse%3B%0A%7D%0Atable%20th%20%7B%0Aborder%2Dwidth%3A%202px%3B%0Apadding%3A%205px%3B%0Aborder%2Dstyle%3A%20inset%3B%0A%7D%0Atable%20td%20%7B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dstyle%3A%20inset%3B%0Aline%2Dheight%3A%2018px%3B%0Apadding%3A%205px%205px%3B%0A%7D%0Atable%2C%20table%20th%2C%20table%20td%20%7B%0Aborder%2Dleft%2Dstyle%3A%20none%3B%0Aborder%2Dright%2Dstyle%3A%20none%3B%0A%7D%0Atable%20thead%2C%20table%20tr%2Eeven%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Ap%20%7B%0Amargin%3A%200%2E5em%200%3B%0A%7D%0Ablockquote%20%7B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Apadding%3A%200%2E25em%200%2E75em%3B%0A%7D%0Ahr%20%7B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%3A%20none%3B%0Aborder%2Dtop%3A%201px%20solid%20%23777%3B%0Amargin%3A%2028px%200%3B%0A%7D%0Adl%20%7B%0Amargin%2Dleft%3A%200%3B%0A%7D%0Adl%20dd%20%7B%0Amargin%2Dbottom%3A%2013px%3B%0Amargin%2Dleft%3A%2013px%3B%0A%7D%0Adl%20dt%20%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Aul%20%7B%0Amargin%2Dtop%3A%200%3B%0A%7D%0Aul%20li%20%7B%0Alist%2Dstyle%3A%20circle%20outside%3B%0A%7D%0Aul%20ul%20%7B%0Amargin%2Dbottom%3A%200%3B%0A%7D%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0Aborder%2Dradius%3A%203px%3B%0Acolor%3A%20%23333%3B%0Awhite%2Dspace%3A%20pre%2Dwrap%3B%20%0A%7D%0Apre%20%7B%0Aborder%2Dradius%3A%203px%3B%0Amargin%3A%205px%200px%2010px%200px%3B%0Apadding%3A%2010px%3B%0A%7D%0Apre%3Anot%28%5Bclass%5D%29%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Acode%20%7B%0Afont%2Dfamily%3A%20Consolas%2C%20Monaco%2C%20%27Courier%20New%27%2C%20monospace%3B%0Afont%2Dsize%3A%2085%25%3B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%7B%0Apadding%3A%202px%200px%3B%0A%7D%0Adiv%2Efigure%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0Aimg%20%7B%0Abackground%2Dcolor%3A%20%23FFFFFF%3B%0Apadding%3A%202px%3B%0Aborder%3A%201px%20solid%20%23DDDDDD%3B%0Aborder%2Dradius%3A%203px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Amargin%3A%200%205px%3B%0A%7D%0Ah1%20%7B%0Amargin%2Dtop%3A%200%3B%0Afont%2Dsize%3A%2035px%3B%0Aline%2Dheight%3A%2040px%3B%0A%7D%0Ah2%20%7B%0Aborder%2Dbottom%3A%204px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Apadding%2Dbottom%3A%202px%3B%0Afont%2Dsize%3A%20145%25%3B%0A%7D%0Ah3%20%7B%0Aborder%2Dbottom%3A%202px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Afont%2Dsize%3A%20120%25%3B%0A%7D%0Ah4%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23f7f7f7%3B%0Amargin%2Dleft%3A%208px%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Ah5%2C%20h6%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Aa%20%7B%0Acolor%3A%20%230033dd%3B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0Aa%3Ahover%20%7B%0Acolor%3A%20%236666ff%3B%20%7D%0Aa%3Avisited%20%7B%0Acolor%3A%20%23800080%3B%20%7D%0Aa%3Avisited%3Ahover%20%7B%0Acolor%3A%20%23BB00BB%3B%20%7D%0Aa%5Bhref%5E%3D%22http%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0Aa%5Bhref%5E%3D%22https%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0A%0Acode%20%3E%20span%2Ekw%20%7B%20color%3A%20%23555%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Edt%20%7B%20color%3A%20%23902000%3B%20%7D%20%0Acode%20%3E%20span%2Edv%20%7B%20color%3A%20%2340a070%3B%20%7D%20%0Acode%20%3E%20span%2Ebn%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Efl%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Ech%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Est%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Eco%20%7B%20color%3A%20%23888888%3B%20font%2Dstyle%3A%20italic%3B%20%7D%20%0Acode%20%3E%20span%2Eot%20%7B%20color%3A%20%23007020%3B%20%7D%20%0Acode%20%3E%20span%2Eal%20%7B%20color%3A%20%23ff0000%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Efu%20%7B%20color%3A%20%23900%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Eer%20%7B%20color%3A%20%23a61717%3B%20background%2Dcolor%3A%20%23e3d2d2%3B%20%7D%20%0A" type="text/css" />
</head>
<body>
<h1 class="title toc-ignore">NCRMP Benthics statistical package in R</h1>
<h4 class="author">Sarah Groves, Bethany Williams, Shay Viehman</h4>
<h4 class="date">2024-03-04</h4>
<div id="TOC">
<ul>
<li><a href="#description">Description</a>
<ul>
<li><a href="#installation">Installation</a></li>
</ul></li>
<li><a href="#to-use-this-package-as-a-data-repository">To use this package as a data repository</a>
<ul>
<li><a href="#datasets">Datasets</a></li>
</ul></li>
<li><a href="#to-use-the-functions-in-this-package">To use the functions in this package</a></li>
<li><a href="#functions-for-specific-regions">Functions for specific regions</a>
<ul>
<li><a href="#benthic-cover">Benthic cover</a></li>
<li><a href="#coral-density">Coral density</a></li>
<li><a href="#species-richness-and-diversity">Species richness and diversity</a></li>
<li><a href="#mortality">Mortality</a></li>
<li><a href="#invertebrate-density">Invertebrate density</a></li>
<li><a href="#diseasebleaching-prevalence">Disease/bleaching prevalence</a></li>
</ul></li>
<li><a href="#functions-for-all-regions-and-years">Functions for all regions and years</a>
<ul>
<li><a href="#esa-listed-corals---presence-absence">ESA listed corals - presence absence</a></li>
<li><a href="#bleaching-abundance">Bleaching abundance</a></li>
</ul></li>
<li><a href="#frequently-asked-questions">Frequently asked questions:</a></li>
<li><a href="#ncrmp-species-filter-developed-in-status-report-meetings">NCRMP species filter developed in status report meetings</a></li>
<li><a href="#disclaimer">Disclaimer</a></li>
</ul>
</div>
<div id="description" class="section level1">
<h1>Description</h1>
<p>The ncrmp.benthic.analysis package is designed to use benthic coral reef data collected from the Atlantic regions of NOAA’s National Coral Reef Monitoring Program (NCRMP) to complete the following:</p>
<ol style="list-style-type: decimal">
<li><p>Compute summary statistics (e.g. coral density, percent cover, species richness, old and recent mortality, disease prevalence, <em>Diadema</em> density) from the site to the regional level as well as presence/absence of ESA species and bleaching abundance at the strata and site levels, respectively.</p></li>
<li><p>House all current NCRMP benthic data ranging from analysis ready data to regional domain estimates in a standardized format. This includes all metrics listed in item #1 calculated at the site, strata and regional level (as applicable) as well as the most recent sampling grids and NTOT files. There are over 250 dataframes stored in this package.</p></li>
</ol>
<p>Note:</p>
<ul>
<li><p>This package assumes some familiarity with NCRMP sampling methods and analysis ready (AR) data formats. NCEI and CoRIS archived AR data, data dictionaries and sampling protocols can be found on the NCRMP project page, <a href="https://coastalscience.noaa.gov/project/national-coral-reef-monitoring-program-biological-socioeconomic/" class="uri">https://coastalscience.noaa.gov/project/national-coral-reef-monitoring-program-biological-socioeconomic/</a> under “Products, Datasets and Reports”</p></li>
<li><p>This package currently uses NOAA’s NCRMP Atlantic benthic data only. See <a href="https://github.com/jeremiaheb/rvc#reef-visual-census-statistical-package-in-r" class="uri">https://github.com/jeremiaheb/rvc#reef-visual-census-statistical-package-in-r</a> for Atlantic fish R package.</p></li>
<li><p>Where indicated in file names by NCRMP_FRRP or NCRMP_DRM, NCRMP and Disturbrance Response Monitoring (DRM; formerly known as Florida Reef Resilience Program or FRRP) data from 2014 to present have been combined during co-sampling (even) years. DRM only data are used for non-NCRMP (odd) years. We are in the process of changing the naming convention from FRRP to DRM but at present DRM and FRRP are used interchangeably. Please be patient while we complete this transition.</p></li>
<li><p>SEFCRI 2014 coral demographics, benthic cover and invertebrates/ESA corals data, FLK 2014 benthic cover and invertebrates/ESA corals data, and Tortugas 2018 coral demographic data are 2 stage (2 transects per site). Site level metrics for these regions and years are the mean of transect 1 and transect 2. Strata and regional means are then calculated from these site level data.</p></li>
</ul>
<p>For questions, please contact the repository owner, Shay Viehman, <a href="mailto:shay.viehman@noaa.gov" class="email">shay.viehman@noaa.gov</a></p>
<div id="ncrmp-regions-and-sampling-years" class="section level3">
<h3>NCRMP Regions and sampling years</h3>
<ul>
<li>Florida:
<ul>
<li>Southeast Florida (SEFCRI; 2014, 2016, 2018, 2020, 2022)</li>
<li>Florida Keys (FLK; 2014, 2016, 2018, 2020*, 2022)</li>
<li>Dry Tortugas (Tortugas; 2014, 2016, 2018, 2020, 2022)</li>
</ul></li>
<li>Caribbean:
<ul>
<li>St. Thomas & St. John (STTSTJ; 2013, 2015, 2017, 2019, 2021)</li>
<li>St. Croix (STX; 2015, 2017, 2019, 2021)</li>
<li>Puerto Rico (PRICO; 2014, 2016, 2019, 2021)</li>
</ul></li>
<li>Gulf of Mexico:
<ul>
<li>Flower Garden Banks National Marine Sanctuary (GOM; 2013, 2015, 2018, 2022)</li>
</ul></li>
</ul>
<p>Upcoming data additions: Caribbean 2023 (in 2024)</p>
</div>
<div id="installation" class="section level2">
<h2>Installation</h2>
<ol style="list-style-type: decimal">
<li><p>Download the zipped R package using the green “Clone or download” button. Unzip the file.</p></li>
<li><p>In R studio, open the ncrmp.benthics.analysis R project in the folder of the same name and use the following code to install the pacakge. You must be in the in the ncrmp.benthics.analysis R project. If you aleady have devtools installed you can skip the first line.</p></li>
</ol>
<pre><code>install.packages('devtools')
devtools::install()</code></pre>
<ol start="3" style="list-style-type: decimal">
<li><p>Exit the ncrmp.benthics.analysis R project and check your R library to confirm the package installed. At this point you can either delete the files from the zipped folder or retain them if you are interested in the analysis code.</p></li>
<li><p>From your current project, use the following code to load and use the package.</p></li>
</ol>
<pre><code>library(ncrmp.benthics.analysis) </code></pre>
<ol start="5" style="list-style-type: decimal">
<li>To update the package (when new data is added), repeat steps 1-4. If you are having trouble, try deleting the old version first before intalling the new one.</li>
</ol>
<p>Note: Requires R version 3.4.1 or higher.</p>
<p>Currently, you cannot load the package directly from Git Hub using devtools::install_github(‘shgroves/NCRMP_benthics’). Future updates will inlcude this feature.</p>
<hr />
</div>
</div>
<div id="to-use-this-package-as-a-data-repository" class="section level1">
<h1>To use this package as a data repository</h1>
<p>To use this package as a data repository requires very little experience with R! You will need to have R version 3.4.1 or higher installed on your computer as well as R Studio desktop. Please see <a href="https://cran.r-project.org/doc/manuals/r-release/R-admin.html" class="uri">https://cran.r-project.org/doc/manuals/r-release/R-admin.html</a> and <a href="https://www.rstudio.com/products/rstudio/download/" class="uri">https://www.rstudio.com/products/rstudio/download/</a> for more information.</p>
<p>Because all datasets are stored in the R package, all that is required to access these dataframes is to load the package, and type the name of the dataset. You can then begin using it in your code or you can assign it to an object if you want to store it in your Global Environment.</p>
<p><strong>Examples:</strong></p>
<p><strong>Export a dataframe</strong></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># require(ncrmp.benthics.analysis)</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="co"># write.csv(NCRMP_DRM_FLK_2014_18_density_site, "Your file path\\NCRMP_DRM_FLK_14_16_density_site.csv", row.names = F)</span></span></code></pre></div>
<p><strong>Use a dataframe in a ggplot</strong></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="co">#> Loading required package: ncrmp.benthics.analysis</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ggplot2)</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Load weighted strata means</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>Hardcoral <span class="ot"><-</span> NCRMP_STTSTJ_2013_21_cover_region <span class="sc">%>%</span></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> dplyr<span class="sc">::</span><span class="fu">ungroup</span>() <span class="sc">%>%</span></span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> <span class="co"># filter to just hardcoral</span></span>
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> dplyr<span class="sc">::</span><span class="fu">filter</span>(cover_group <span class="sc">==</span> <span class="st">"HARD CORALS"</span>) <span class="sc">%>%</span></span>
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> <span class="co"># Change Year to factor so R sees it as a grouping variable and not a number</span></span>
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> dplyr<span class="sc">::</span><span class="fu">mutate</span>(<span class="at">YEAR =</span> <span class="fu">as.factor</span>(YEAR))</span>
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a><span class="co"># Create your plot</span></span>
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(Hardcoral, <span class="fu">aes</span>(<span class="at">x =</span> YEAR, <span class="at">y =</span> avCvr, <span class="at">group =</span> YEAR)) <span class="sc">+</span></span>
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_bar</span>(<span class="fu">aes</span>(<span class="at">fill =</span> YEAR), <span class="at">stat=</span><span class="st">"identity"</span>, <span class="at">colour=</span><span class="st">"black"</span>,</span>
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> <span class="at">position=</span><span class="fu">position_dodge</span>(),</span>
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> <span class="at">size=</span>.<span class="dv">3</span>) <span class="sc">+</span></span>
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a><span class="co"># Add error bars</span></span>
<span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymax =</span> avCvr<span class="sc">+</span>SE, <span class="at">ymin =</span> avCvr<span class="sc">-</span>SE), <span class="at">width =</span> .<span class="dv">5</span>, <span class="at">position=</span><span class="fu">position_dodge</span>(<span class="dv">1</span>)) <span class="sc">+</span></span>
<span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a><span class="co"># Set the y axis scale</span></span>
<span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_y_continuous</span>(<span class="at">limits =</span> <span class="fu">c</span>(<span class="dv">0</span>,<span class="dv">25</span>), <span class="at">expand =</span> <span class="fu">c</span>(<span class="dv">0</span>, <span class="dv">0</span>)) <span class="sc">+</span></span>
<span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a><span class="co"># Add axis labels</span></span>
<span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a> <span class="fu">xlab</span>(<span class="st">"Year"</span>) <span class="sc">+</span></span>
<span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a> <span class="fu">ylab</span>(<span class="st">"Cover (%)"</span>) <span class="sc">+</span></span>
<span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">title =</span> <span class="st">"Hard coral cover"</span>) <span class="sc">+</span> </span>
<span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a><span class="co"># Remove legend </span></span>
<span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">legend.position=</span><span class="st">"none"</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAMAAAAjXV6yAAABAlBMVEUAAAAAADoAAGYAOjoAOmYAOpAAZrYAsPYAv30zMzM6AAA6ADo6AGY6OgA6OmY6ZmY6kNtNTU1NTW5NTY5NbqtNjshmAABmADpmAGZmOgBmZmZmkNtmtttmtv9uTU1uTW5uTY5ubqtuq8huq+SOTU2OTW6OTY6OyP+QOgCQOmaQZmaQkDqQkLaQtpCQttuQ27aQ2/+jpQCrbk2rbm6rbo6ryKur5P+2ZgC2tpC2ttu229u22/+2/9u2///Ijk3I///bkDrbtmbbtpDb29vb/7bb///kq27k///na/Pr6+v4dm3/tmb/yI7/25D/27b/29v/5Kv//7b//8j//9v//+T///8AuyeQAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAJtklEQVR4nO2dC3vTNhiFXWizEdhGGWRjI2Ub3ZrdoGNbsxslMArr0rCkwf//r0yS7/EnH7mpHaU553mgsX0cS2+lT7IrS0FIVSpYdQJ8FwEBERAQAQEREBABAREQEAEB1QU0uvbM/Jz1blsc80HH+dvmg52TmgloWwQEREBAywF68UEQbH1uoIyCa3+GL7rB9h8ZIL15qD+8vR8E23/mfOl5KaCSN7rSrNeJdn2YO71NLQVoFBj1Vcqvd4OdE7O9fT8BNNabWyrX4278Ke+LzksAlb2Tbt/s76tPxdMvK+9Oqg0oSHRbpVf/NifdjvqkNhW0rcfh20EQA5oPVJ5eGF/wQJ+5cxL58ufF2RW9+tjw2jN1TO16mV6mXS0DSOnv377rBjrlumBNunqfzrhRtJntGW4dRr78eTEgwRuO1D9dw+JjI40qPr1FLVXForKfZlRXh1yQjupI9mGsARkgC+fJXgNGf+U4/o2kp7eqZQDNesF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9Thm9VOh2TEW6G9oV4GkO4eTR8epXdrZj0yk5V7jubiK9XIHEbdVifz+b7aguZ4K3eBkpYBdKaTc3yQ9JSi9ci0pF+HaC6+Uo2/WeyximZb/7ZojrdySS9p2RikEpGlJQFj6zeVzNkr1W7fbO2QlcxVNwAF80LSS1oSkO5GZndr0VWme3fkhJXNxVeq4Tdbb3nKZlPF5HQUzXorbAzQ+f6j/N1achU5IxazHIdEsxSBbGYVfr8S0RfNZitsCtB0T+ctu1urzPMlmI8f1UqG3gPM0VbYEKD427O7tfKSfw7m7JVqYLZVRtGskyBFrKI55dMMoKRjUuraSHX/EsyWECSbVXdMqpBFc9a1aipIX30REBABAREQEAEBERCQj4DmA7Oa4KTbgdbm5SOgeE3cYdVagq3JS0BmQcpJt4+NzctPQLNeJ1oweD4IAl3fzPKLt8PJre+DilVgm5CfgMLx1o83DzWfjln31aySq4rVCsKSp4BUydFhyCwarOj8p6PR5ObhCqqdp4Di9ZRH0XgLxWoc6BVOJzcrFzltQp4DihuyWW/r0JQgAkoUARrHy+KONagxS1BOEaD5QJFRYDSoSZeAcorXdNfNvC5FQ/XjSa9PQP6JgIAICIiAgAgIiICACAiIgIAICIiAgP4HDhg2EbHJ5bYAAAAASUVORK5CYII=" /><!-- --></p>
<p><strong>Add dataframe to the Global Environment</strong></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># require(ncrmp.benthics.analysis)</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="co">#</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="co"># #The 'data' function will load a dataframe to the Global Environment keeping the existing name, </span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="co"># data("NCRMP_DRM_FLK_2014_22_density_site")</span></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a><span class="co">#</span></span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="co"># or you can give it a new name </span></span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a><span class="co">#</span></span>
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a><span class="co"># dat <- NCRMP_DRM_FLK_2014_22_density_site</span></span></code></pre></div>
<div id="datasets" class="section level2">
<h2>Datasets</h2>
<p>Datasets contained within the package at the strata and regional level are created using the default function parameters:</p>
<ul>
<li>For Florida regions:
<ul>
<li>project = “NCRMP” (NCRMP only) or “NCRMP_DRM” (NCRMP and DRM combined)</li>
<li>species filter = FALSE (filter not applied)</li>
</ul></li>
<li>For all Carib regions:
<ul>
<li>project = “NCRMP”</li>
<li>species filter = FALSE</li>
</ul></li>
<li>For GOM:
<ul>
<li>project = “NCRMP”</li>
<li>species filter = FALSE</li>
</ul></li>
</ul>
<div id="analysis-ready-ar-data" class="section level3">
<h3>Analysis Ready (AR) data</h3>
<p>Analysis ready NCRMP datasets for all regions and years are contained within this package in the most recent NCRMP Atlantic archive format. AR datasets can be identified because they begin with the region code followed by the year and then the data type; benthic_cover, coral_demographics or inverts_ESAcorals. Two stage (2 transect) data are identified in the file name except for the Tortugas 2018 data. Tortugas 2018 coral demographics surveys were a joint mission between NCRMP and DRM where two transects were conducted at each site. The NCRMP and DRM data are combined and indistinguishable. All other datasets are single transect.</p>
<ul>
<li>Data format:
<ul>
<li>REGION_YEAR_datatype</li>
</ul></li>
<li>Examples:
<ul>
<li>FLK_2016_coral_demographics,</li>
<li>SEFCRI_2014_2stage_benthic_cover<br />
</li>
<li>FGBNMS_2013_inverts_ESAcorals</li>
</ul></li>
</ul>
<p>Additionally, there are two datasets that combine all regions and years into a single dataframe. * NCRMP_benthic_cover_All_regions_years * NCRMP_demo_All_regions_years</p>
<p>In addition, the following AR Florida DRM and Sanctuary Coral Reef Ecosystem Assessment Monitoring (SCREAM) datasets in NCRMP format are stored in the package. Combined DRM and SCREAM data are from 1999 to 2013 (not all regions are sampled each year) and individual DRM regions are 2014 to the most recent year of sampling.</p>
<ul>
<li>preNCRMP_SCREAM_DRM_coral_demographics<br />
</li>
<li>DRM_SEFCRI_2014_2022_2stage_coral_demographics - includes data from 2014-2022</li>
<li>DRM_FLK_2014_2022_2stage_coral_demographics - includes data from 2014-2022</li>
<li>DRM_Tort_2014_2022_2stage_coral_demographics - includes data from 2014-2022</li>
</ul>
</div>
<div id="summary-dataframes" class="section level3">
<h3>Summary dataframes</h3>
<p>Summary dataframes are provided for site, strata and weighted regional means. Every function listed below can produce several dataframes. Although there are too many to list individually, all provided dataframes follow a standard naming convention. Summary dataframes can be identified because they begin with the project or projects (NCRMP or NCRMP_DRM), followed by the region, year(s) and data type and level (site, strata, region). See associated functions used to create these dataframes (below) for more information. To view all of the data contained within this package you can 1. download the package from GitHub and view the ‘data’ folder or 2. use the following code to view all of the datasets in R.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="co"># data(package='ncrmp.benthics.analysis')</span></span></code></pre></div>
<ul>
<li>Data format:
<ul>
<li>PROJECT_REGION_YEAR_datatype_level</li>
</ul></li>
<li>Examples:
<ul>
<li>NCRMP_DRM_FLK_2014_22_dis_prev_site,</li>
<li>NCRMP_FGBNMS_2013_22_density_strata,<br />
</li>
<li>NCRMP_FLK_2014_22_rec_mort_region,</li>
<li>NCRMP_PRICO_2014_21_richness_strata,</li>
<li>NCRMP_STX_2015_21_cover_region</li>
</ul></li>
</ul>
<p>In addition, there are three dataframes that contain all regions and years</p>
<ul>
<li>NCRMP_AllRegions_Years_ESA_PresAbs_Site</li>
<li>NCRMP_AllRegions_Years_ESA_PresAbs_Strat</li>
<li>NCRMP_bleaching_abundance_Allyears_Allregions</li>
</ul>
</div>
<div id="shapefiles-and-ntot-files" class="section level3">
<h3>Shapefiles and NTOT files</h3>
<p>The most recent sampling grid shapefiles used for site allocation and all NTOT (grid summary) files are also contained in the package. Grids can be used in R or exported as shapefiles. The NTOT files are required to properly apply the weighting scheme to summary data and often differ between years. The Florida Keys National Marine Sanctuary (FKNMS) and the Flower Garden Banks National Marine Sanctuary (FGBNMS) boundary polygons are also contained in the package. More boundary polygons for other regions will be added in future updates.</p>
<ul>
<li>Sampling grids:
<ul>
<li>SEFCRI_2018_sample_frame</li>
<li>FLK_2020_coral_demographics</li>
<li>Tort_2020_sample_frame</li>
<li>STTSTJ_2021_sample_frame_WGS1984</li>
<li>STX_2021_sample_frame_WGS1984</li>
<li>PRICO_2021_sample_frame_WGS1984</li>
<li>FGBNMS_2018_sample_frame_WGS1984</li>
</ul></li>
<li>NTOT files:
<ul>
<li>USVI_2021_NTOT (STTSTJ & STX)</li>
<li>FLK: FLK_2014_NTOT, FLK_2016_NTOT, FLK_2018_NTOT, FLK_2020_NTOT, FLK_2022_NTOT</li>
<li>SEFCRI: SEFL_2014_NTOT, SEFL_2016_NTOT, SEFL_2018_NTOT, SEFL_2020_NTOT, SEFL_2020_NTOT</li>
<li>Tortugas: Tort_2014_NTOT, Tort_2016_NTOT, Tort_2018_NTOT, Tort_2020_NTOT, Tort_2022_NTOT</li>
<li>PRICO_2021_NTOT</li>
<li>FGBNMS_2022_NTOT</li>
</ul></li>
<li>Boundaries
<ul>
<li>FKNMS_boundary</li>
<li>FGBNMS_boundary</li>
</ul></li>
</ul>
</div>
<div id="additional-files" class="section level3">
<h3>Additional files</h3>
<ul>
<li>ncrmp_frrp_sppcodes: species code, species names and benthic categories for NCRMP and other Florida monitoring programs.</li>
</ul>
</div>
</div>
</div>
<div id="to-use-the-functions-in-this-package" class="section level1">
<h1>To use the functions in this package</h1>
<p>If you would like to run the AR data through the functions, apply preset species filters to certain functions or just know more about how NCRMP metrics are calculated, please feel free to use these functions or check out the code. Comments or suggestions on how to improve the package are welcome.</p>
</div>
<div id="functions-for-specific-regions" class="section level1">
<h1>Functions for specific regions</h1>
<div id="these-functions-create-outputs-that-contain-a-single-region-and-either-single-or-multiple-sampling-years.-they-all-use-a-stratified-random-sampling-weighting-scheme-to-calculate-regional-sampling-domain-level-metrics." class="section level3">
<h3>These functions create outputs that contain a single region and either single or multiple sampling years. They all use a stratified random sampling weighting scheme to calculate regional (sampling domain) level metrics.</h3>
</div>
<div id="benthic-cover" class="section level2">
<h2>Benthic cover</h2>
<div id="a.-ncrmp_calculate_cover" class="section level3">
<h3>1a. NCRMP_calculate_cover</h3>
<p><strong>Calculates percent cover from species to regional level for individual years</strong></p>
<ul>
<li>parameters:
<ul>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>project: “NCRMP”, or “MIR” Note - MIR option is in development.</p></li>
</ul></li>
<li>outputs (dataframes):
<ul>
<li><p>cover_group_key: a region specific key for species codes and major benthic categories</p></li>
<li><p>percent_cover_species: site level percent cover by species</p></li>
<li><p>percent_cover_site: site level percent cover by major benthic category</p></li>
<li><p>cover_strata: strata level mean percent cover of major benthic categories (unweighted)</p></li>
<li><p>Domain estimates: weighted regional (domain level) percent cover of major benthic categories</p></li>
<li><p>Domain_check: QAQC check that sums the regional percent cover. Should equal ~100</p></li>
<li><p>cover_check_site: QAQC check that sums the percent cover for each site. Should equal 100</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_LPI_data, load_NCRMP_benthic_cover_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function and assign names to dataframes </span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_calculate_cover</span>(<span class="at">region =</span> <span class="st">"SEFCRI"</span>, <span class="at">project =</span> <span class="st">"NCRMP"</span>)</span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a>NCRMP_SEFCRI_2014_22_percent_cover_species <span class="ot"><-</span> tmp<span class="sc">$</span>percent_cover_species</span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a>NCRMP_SEFCRI_2014_22_percent_cover_site <span class="ot"><-</span> tmp<span class="sc">$</span>percent_cover_site</span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a>NCRMP_SEFCRI_2014_22_cover_group_key <span class="ot"><-</span> tmp<span class="sc">$</span>cover_group_key</span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a>NCRMP_SEFCRI_2014_22_cover_strata <span class="ot"><-</span> tmp<span class="sc">$</span>cover_strata</span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true" tabindex="-1"></a>NCRMP_SEFCRI_2014_22_cover_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est</span>
<span id="cb7-14"><a href="#cb7-14" aria-hidden="true" tabindex="-1"></a>NCRMP_SEFCRI_2014_22_Domain_check <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_check </span>
<span id="cb7-15"><a href="#cb7-15" aria-hidden="true" tabindex="-1"></a>cover_check_site <span class="ot"><-</span> tmp<span class="sc">$</span>cover_check_site</span></code></pre></div>
</div>
<div id="b.-ncrmp_colony_percent_cover" class="section level3">
<h3>1b. NCRMP_colony_percent_cover</h3>
<p><strong>Calculates species-specific coral cover from at regional level (weighted) for individual years. Also produces a barplot of the most recent years data</strong></p>
<ul>
<li>parameters:
<ul>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>ptitle: a string indicating the title of the plot</p></li>
<li><p>file_path: a string indicating the file path of stored barplot of most recent years’ data</p></li>
</ul></li>
<li>outputs (dataframes):
<ul>
<li><p>region_means: weighted regional (domain level) percent cover of coral species</p></li>
<li><p>a barplot of weighted regional % cover by coral species for the most recent year’s data, exported to the specified filepath</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_LPI_data, load_NCRMP_benthic_cover_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function and assign names to dataframes </span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span><span class="fu">NCRMP_colony_percent_cover</span>(<span class="at">region =</span> <span class="st">"Tortugas"</span>,</span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="at">ptitle =</span> <span class="st">"The Dry Tortugas"</span>,</span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> <span class="at">file_path =</span> <span class="st">"K:/_BioGeoProjects/NCRMP/Data Analysis/Analysis ready data/Figures"</span> )</span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_percent_cover_region_species <span class="ot"><-</span> tmp<span class="sc">$</span>region_means</span></code></pre></div>
</div>
<div id="ncrmp_make_weighted_lpi_data" class="section level3">
<h3>2. NCRMP_make_weighted_LPI_data</h3>
<p><strong>Applies weighting scheme to benthic cover data</strong></p>
<p>Analysis level strata varies between regions. In the Caribbean (USVI, PRICO), strata is represented by HABITAT CODE + DEPTH STRAT. In GOM, only one strata is used: FGBNMS, so essentially there is no weighting there. In FLorida, strata is a combination of STRAT + PROT. However, there is no PROT in SEFCRI. In FLK, PROT is always reset to 0 because the benthic sites are not allocated at the PROT level. In Tortugas, PROT is maintained as is. These are the recommended and default settings.</p>
<p>This function is called within NCRMP_calculate_cover so the initial parameters you provide for region and year. will be passed on.</p>
<p>Example of weighting application for Florida:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="co">#Calculate average cover (avcvr), stratum variance (svar), n and std at the strata and regional level using STRAT + PROT as the analysis strata. Inputdata = 1 stage site level cover for major benthic categories and ntot = the most recent NTOT file for the region, regardless of sampling year. </span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="co"># cover_est <- inputdata %>%</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a><span class="co"># # group by analysis level strata</span></span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(ANALYSIS_STRATUM = paste(STRAT, "/ PROT =", PROT, sep = " ")) %>%</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(ANALYSIS_STRATUM, STRAT, PROT, cover_group) %>% </span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(</span></span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate mean cover</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a><span class="co"># avcvr = mean(Percent_Cvr),</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate stratum variance</span></span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a><span class="co"># svar = var(Percent_Cvr),</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate N</span></span>
<span id="cb9-14"><a href="#cb9-14" aria-hidden="true" tabindex="-1"></a><span class="co"># n = sum(n),</span></span>
<span id="cb9-15"><a href="#cb9-15" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate mean stratum depth</span></span>
<span id="cb9-16"><a href="#cb9-16" aria-hidden="true" tabindex="-1"></a><span class="co"># MIN_DEPTH = mean(MIN_DEPTH),</span></span>
<span id="cb9-17"><a href="#cb9-17" aria-hidden="true" tabindex="-1"></a><span class="co"># MAX_DEPTH = mean(MAX_DEPTH),</span></span>
<span id="cb9-18"><a href="#cb9-18" aria-hidden="true" tabindex="-1"></a><span class="co"># DEPTH_M = (MIN_DEPTH+MAX_DEPTH)/2) %>%</span></span>
<span id="cb9-19"><a href="#cb9-19" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true" tabindex="-1"></a><span class="co"># # convert 0 for stratum variance so that the sqrt is a small # but not a 0</span></span>
<span id="cb9-21"><a href="#cb9-21" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(svar = dplyr::case_when(svar == 0 ~ 0.00000001,</span></span>
<span id="cb9-22"><a href="#cb9-22" aria-hidden="true" tabindex="-1"></a><span class="co"># TRUE ~ svar)) %>%</span></span>
<span id="cb9-23"><a href="#cb9-23" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(std = sqrt(svar))</span></span>
<span id="cb9-24"><a href="#cb9-24" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb9-25"><a href="#cb9-25" aria-hidden="true" tabindex="-1"></a><span class="co"># cover_est <- cover_est %>%</span></span>
<span id="cb9-26"><a href="#cb9-26" aria-hidden="true" tabindex="-1"></a><span class="co"># # Merge ntot with cover_est</span></span>
<span id="cb9-27"><a href="#cb9-27" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::full_join(., ntot) %>%</span></span>
<span id="cb9-28"><a href="#cb9-28" aria-hidden="true" tabindex="-1"></a><span class="co"># # stratum estimates</span></span>
<span id="cb9-29"><a href="#cb9-29" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(whavcvr = wh * avcvr,</span></span>
<span id="cb9-30"><a href="#cb9-30" aria-hidden="true" tabindex="-1"></a><span class="co"># whsvar = wh^2 * svar,</span></span>
<span id="cb9-31"><a href="#cb9-31" aria-hidden="true" tabindex="-1"></a><span class="co"># whstd = wh * std,</span></span>
<span id="cb9-32"><a href="#cb9-32" aria-hidden="true" tabindex="-1"></a><span class="co"># n = tidyr::replace_na(n, 0))</span></span>
<span id="cb9-33"><a href="#cb9-33" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb9-34"><a href="#cb9-34" aria-hidden="true" tabindex="-1"></a><span class="co"># # Reformat data</span></span>
<span id="cb9-35"><a href="#cb9-35" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb9-36"><a href="#cb9-36" aria-hidden="true" tabindex="-1"></a><span class="co"># # cover, unweighted by strata</span></span>
<span id="cb9-37"><a href="#cb9-37" aria-hidden="true" tabindex="-1"></a><span class="co"># cover_strata <- cover_est %>%</span></span>
<span id="cb9-38"><a href="#cb9-38" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::select(REGION, YEAR, ANALYSIS_STRATUM, STRAT, RUG_CD, PROT, DEPTH_M, NTOT, ngrtot, wh, cover_group, n, avcvr, svar, std) %>%</span></span>
<span id="cb9-39"><a href="#cb9-39" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(METHOD = "UNWEIGHTED") %>%</span></span>
<span id="cb9-40"><a href="#cb9-40" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(n = tidyr::replace_na(n, 0))</span></span>
<span id="cb9-41"><a href="#cb9-41" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb9-42"><a href="#cb9-42" aria-hidden="true" tabindex="-1"></a><span class="co"># # Calculate Domain Estimates</span></span>
<span id="cb9-43"><a href="#cb9-43" aria-hidden="true" tabindex="-1"></a><span class="co"># Domain_est <- cover_est %>%</span></span>
<span id="cb9-44"><a href="#cb9-44" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(REGION, YEAR, cover_group) %>%</span></span>
<span id="cb9-45"><a href="#cb9-45" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(avCvr = sum(whavcvr),</span></span>
<span id="cb9-46"><a href="#cb9-46" aria-hidden="true" tabindex="-1"></a><span class="co"># var = sum(whsvar, na.rm = T),</span></span>
<span id="cb9-47"><a href="#cb9-47" aria-hidden="true" tabindex="-1"></a><span class="co"># std = sqrt(var),</span></span>
<span id="cb9-48"><a href="#cb9-48" aria-hidden="true" tabindex="-1"></a><span class="co"># ngrtot = sum(NTOT) )</span></span></code></pre></div>
<p>Example of weighting application for Caribbean and GOM:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Calculate average cover (avcvr), stratum variance (svar), n and std at the strata and regional level using HABITAT + DEPTH_STRAT as the analysis strata. Inputdata = 1 stage site level cover for major benthic categories and ntot = the most recent NTOT file for the region, regardless of sampling year. </span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="co"># cover_est <- inputdata %>%</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="co"># # group by analysis level strata</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(YEAR, ANALYSIS_STRATUM, STRAT, cover_group) %>% </span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(</span></span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a><span class="co"># # compute average cover</span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a><span class="co"># avcvr = mean(Percent_Cvr),</span></span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a><span class="co"># # compute stratum variance</span></span>
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a><span class="co"># svar = var(Percent_Cvr),</span></span>
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate N</span></span>
<span id="cb10-13"><a href="#cb10-13" aria-hidden="true" tabindex="-1"></a><span class="co"># n = sum(n),</span></span>
<span id="cb10-14"><a href="#cb10-14" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate mean stratum depth</span></span>
<span id="cb10-15"><a href="#cb10-15" aria-hidden="true" tabindex="-1"></a><span class="co"># MIN_DEPTH = mean(MIN_DEPTH),</span></span>
<span id="cb10-16"><a href="#cb10-16" aria-hidden="true" tabindex="-1"></a><span class="co"># MAX_DEPTH = mean(MAX_DEPTH),</span></span>
<span id="cb10-17"><a href="#cb10-17" aria-hidden="true" tabindex="-1"></a><span class="co"># DEPTH_M = (MIN_DEPTH+MAX_DEPTH)/2) %>%</span></span>
<span id="cb10-18"><a href="#cb10-18" aria-hidden="true" tabindex="-1"></a><span class="co"># # convert 0 for stratum variance so that the sqrt is a small # but not a 0</span></span>
<span id="cb10-19"><a href="#cb10-19" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(svar = dplyr::case_when(svar == 0 ~ 0.00000001,</span></span>
<span id="cb10-20"><a href="#cb10-20" aria-hidden="true" tabindex="-1"></a><span class="co"># TRUE ~ svar)) %>%</span></span>
<span id="cb10-21"><a href="#cb10-21" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(std = sqrt(svar))</span></span>
<span id="cb10-22"><a href="#cb10-22" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb10-23"><a href="#cb10-23" aria-hidden="true" tabindex="-1"></a><span class="co"># cover_est <- cover_est %>%</span></span>
<span id="cb10-24"><a href="#cb10-24" aria-hidden="true" tabindex="-1"></a><span class="co"># # Merge ntot with cover_est</span></span>
<span id="cb10-25"><a href="#cb10-25" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::full_join(., ntot) %>%</span></span>
<span id="cb10-26"><a href="#cb10-26" aria-hidden="true" tabindex="-1"></a><span class="co"># # stratum estimates</span></span>
<span id="cb10-27"><a href="#cb10-27" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(whavcvr = wh * avcvr,</span></span>
<span id="cb10-28"><a href="#cb10-28" aria-hidden="true" tabindex="-1"></a><span class="co"># whsvar = wh^2 * svar,</span></span>
<span id="cb10-29"><a href="#cb10-29" aria-hidden="true" tabindex="-1"></a><span class="co"># whstd = wh * std,</span></span>
<span id="cb10-30"><a href="#cb10-30" aria-hidden="true" tabindex="-1"></a><span class="co"># n = tidyr::replace_na(n, 0),</span></span>
<span id="cb10-31"><a href="#cb10-31" aria-hidden="true" tabindex="-1"></a><span class="co"># # Add the following to match FL format</span></span>
<span id="cb10-32"><a href="#cb10-32" aria-hidden="true" tabindex="-1"></a><span class="co"># PROT = NA,</span></span>
<span id="cb10-33"><a href="#cb10-33" aria-hidden="true" tabindex="-1"></a><span class="co"># RUG_CD = NA)</span></span>
<span id="cb10-34"><a href="#cb10-34" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb10-35"><a href="#cb10-35" aria-hidden="true" tabindex="-1"></a><span class="co"># # Reformat data</span></span>
<span id="cb10-36"><a href="#cb10-36" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb10-37"><a href="#cb10-37" aria-hidden="true" tabindex="-1"></a><span class="co"># # cover, unweighted by strata</span></span>
<span id="cb10-38"><a href="#cb10-38" aria-hidden="true" tabindex="-1"></a><span class="co"># cover_strata <- cover_est %>%</span></span>
<span id="cb10-39"><a href="#cb10-39" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::select(REGION, YEAR, ANALYSIS_STRATUM, STRAT, RUG_CD, PROT, DEPTH_M, NTOT, ngrtot, wh, cover_group, n, avcvr, svar, std) %>%</span></span>
<span id="cb10-40"><a href="#cb10-40" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(METHOD = "UNWEIGHTED") %>%</span></span>
<span id="cb10-41"><a href="#cb10-41" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(n = tidyr::replace_na(n, 0))</span></span>
<span id="cb10-42"><a href="#cb10-42" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb10-43"><a href="#cb10-43" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb10-44"><a href="#cb10-44" aria-hidden="true" tabindex="-1"></a><span class="co"># ## Calculate Domain Estimates</span></span>
<span id="cb10-45"><a href="#cb10-45" aria-hidden="true" tabindex="-1"></a><span class="co"># Domain_est <- cover_est %>%</span></span>
<span id="cb10-46"><a href="#cb10-46" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(REGION, YEAR, cover_group) %>%</span></span>
<span id="cb10-47"><a href="#cb10-47" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(avCvr = sum(whavcvr),</span></span>
<span id="cb10-48"><a href="#cb10-48" aria-hidden="true" tabindex="-1"></a><span class="co"># var = sum(whsvar, na.rm = T),</span></span>
<span id="cb10-49"><a href="#cb10-49" aria-hidden="true" tabindex="-1"></a><span class="co"># std = sqrt(var),</span></span>
<span id="cb10-50"><a href="#cb10-50" aria-hidden="true" tabindex="-1"></a><span class="co"># ngrtot = sum(NTOT) )</span></span></code></pre></div>
</div>
</div>
<div id="coral-density" class="section level2">
<h2>Coral density</h2>
<div id="a.-ncrmp_drm_calculate_colony_density" class="section level3">
<h3>3a. NCRMP_DRM_calculate_colony_density</h3>
<p><strong>Calculates colony density from site to regional level for all sampling years</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP” (All regions), “NCRMP_DRM” (Florida regions only)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>species_filter: A string indicating whether a region-specific preset species filter should be applied to density calculations (species codes listed) or all species should be included (FALSE; the default).</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>density_species: site level coral density by species</p></li>
<li><p>density_site: site level coral density</p></li>
<li><p>density_strata: strata level coral density (unweighted)</p></li>
<li><p>Domain estimates: weighted regional (domain level) coral density</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data, load_NCRMP_DRM_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_calculate_colony_density</span>(<span class="at">project =</span> <span class="st">"NCRMP_DRM"</span>, </span>
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a> <span class="at">region =</span> <span class="st">"FLK"</span>,</span>
<span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a> <span class="at">species_filter =</span> <span class="st">"FALSE"</span>)</span>
<span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-9"><a href="#cb11-9" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb11-10"><a href="#cb11-10" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb11-11"><a href="#cb11-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-12"><a href="#cb11-12" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_FLK_2014_22_density_species <span class="ot"><-</span> tmp<span class="sc">$</span>density_species</span>
<span id="cb11-13"><a href="#cb11-13" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_FLK_2014_22_density_site <span class="ot"><-</span> tmp<span class="sc">$</span>density_site</span>
<span id="cb11-14"><a href="#cb11-14" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_FLK_2014_22_density_strata <span class="ot"><-</span> tmp<span class="sc">$</span>density_strata</span>
<span id="cb11-15"><a href="#cb11-15" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_FLK_2014_22_density_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est</span></code></pre></div>
</div>
<div id="b.-ncrmp_drm_colony_density_cv_and_occurrence" class="section level3">
<h3>3b. NCRMP_DRM_colony_density_CV_and_occurrence</h3>
<p><strong>Calculates colony density and coefficient of variation (CV) by species at the regional level for all sampling years. Also produces a barplot of occurrence and CV by species for the most recent years data</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP” (All regions), “NCRMP_DRM” (Florida regions only)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>species_filter: A string indicating whether a region-specific preset species filter should be applied to density calculations (species codes listed) or all species should be included (FALSE; the default).</p></li>
<li><p>year: a numeric indicating the year of interest for plotting, usually the most recent year</p></li>
<li><p>ptitle: a string indicating the figure title</p></li>
<li><p>file_path: a string indicating the file path to store the produced figure</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>region_means: weighted regional (domain level) coral density by species</p></li>
<li><p>region_means_cv20: weighted regional (domain level) coral density by species for species with a CV of 20 or less</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data, load_NCRMP_DRM_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_colony_density_CV_and_occurrence</span>(<span class="at">region =</span> <span class="st">"Tortugas"</span>,</span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a> <span class="at">ptitle =</span> <span class="st">"Dry Tortugas"</span>,</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a> <span class="at">year =</span> <span class="dv">2022</span>,</span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a> <span class="at">file_path =</span> <span class="st">"K:/_BioGeoProjects/NCRMP/Data Analysis/Analysis ready data/Figures"</span> , <span class="co">#must be connected to VPN if filepath is to a network drive</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a> <span class="at">species_filter =</span> <span class="st">"NULL"</span>,</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a> <span class="at">project =</span> <span class="st">"NCRMP"</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAgAElEQVR4nO19f4zk1n3fh0FRFEUVN4WSUyLLuLPIxWW1NWIXhR1OnFRwmoLcnLCOjY3iP7xtHJCnAs2MW43Tg7Yu7I5hxGs4ZINAO4yEZIXCKiZytLm9JQHHgZAow0gwEhTBanxdMncXn8+RYjWumj8aFJDZPx5/PJLvcTi75OyPeR8ssDPk43uPj/zO+/H9vM9XiqIIAgIC7eD7TroCAgLnGcLABARahDAwAYEWIQxMQKBFCAND6NlmpyPF6HRM2wsR2umRDJ2O6YUz5GsmeXRML/e102HknoPpAUklTG+Gm7HNTil9GHqMo7PfQlpGR2LWyzNJUrt+I1H51aggfSNHaJwZqpO7B+YbQle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537K7929c+mDP/4gADz40Y89evvut7j2W5kPXvVfis/i/Z+8bn/0waqfguqsSMVe+MLLFx+dspukMp9X/Zce/Vhcjyn3VqM+pxqN1p/dbg0VUXysx8+W+eK18kA5Bnbv7p1LD72TfH7woYu4c5fuMh986OLtl//kHgDce+HLL6UpZ83n3t07lx66W7NXrs6K1OULL3/wU+sPVWYzJZ/3f/L6J9+ffHnVr7i36fU53Wi2/sx2a6aI0mM9frbMF6+dB8oxsG/drdzZ+/5PXv/Y3Scee+yxx554+YNPV/Q8U/IBbj93V71+/fr1609/8OUvVJrYtKzIc6juBGtVKc2v+7k7H+dnWDef04q26k+1WxNFMB5rIzUvv3jtNAjHwN75UNU4694L3ce+/NDT169fv379Y3efqFgLqM4HwKWPr5MfPqpXPFqV6plXjSoBwKu/Nu2no14+pxit1D/fbscvgvlYG6l5+cVr54FyDOzBhy6ms497d+/g4kOFn5BkDob3q49WdKbV+Tz40MX6Na3M6t6fvHz79nOkT33uNl76HH/EWV0lkJ+Pz+GpaVPCqfmccjRe/3K7HbsI9mM9fs2ZL147D5S3yPHOhy699OUX7oHcZDIhzE6mvc2r/ktVVanMB+9XLz43It0ftXByhKwe/Kh9PcbTH7+ER6vMo7JK917oPvHcxaeoCcWR6nMW0Gj92e123CI4j/X4NWe+eK080Aqy76u/9tjnXgJw6eNxl3/vhe4Tdz9G2jA5SZ3moTKfLKNHa7zV1VkRMA7Vz+edL3SfeC43FK+sFiMfPPjRKTdxilCq/1Fxj9tuTRVReKzHz5b54jXWICkEm15AoEUIqpSAQIsQBiYg0CKEgQkItAhhYAICLeL/AzwmIl4tyEHqAAAAAElFTkSuQmCC" /><!-- --></p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_Occ_Den_CV <span class="ot"><-</span> tmp<span class="sc">$</span>region_means</span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_Occ_Den_CV_20 <span class="ot"><-</span> tmp<span class="sc">$</span>region_means_cv20</span></code></pre></div>
</div>
<div id="ncrmp_make_weighted_demo_data" class="section level3">
<h3>4. NCRMP_make_weighted_demo_data</h3>
<p><strong>Applies weighting scheme to coral demographic data (coral density, species richness, mortality, disease/bleaching prevalence).</strong></p>
<p>Analysis level strata varies between regions. In the Caribbean (USVI, PRICO), strata is represented by HABITAT CODE + DEPTH STRAT. In GOM, only one strata is used: FGBNMS, so essentially there is no weighting there. In FLorida, strata is a combination of STRAT + PROT. However, there is no PROT in SEFCRI. In FLK, PROT is always reset to 0 because the benthic sites are not allocated at the PROT level. In Tortugas, PROT is maintained as is. These are the recommended and default settings.</p>
<p>This function is called within NCRMP_DRM_calculate_colony_density so the initial parameters you provide for region and year will be passed on.</p>
<p>Example of weighting application for Florida:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Calculate average density (avden), stratum variance (svar), n and std at the strata and regional level using STRAT + PROT as the analysis strata. Inputdata = 1 stage site level coral density and ntot = the most recent NTOT file for the region, regardless of sampling year. </span></span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a><span class="co"># density_est <- inputdata %>%</span></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a><span class="co"># # group by analysis level strata</span></span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(ANALYSIS_STRATUM = paste(STRAT, "/ PROT =", PROT, sep = " ")) %>%</span></span>
<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(YEAR, ANALYSIS_STRATUM, STRAT, PROT) %>% </span></span>
<span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(</span></span>
<span id="cb14-9"><a href="#cb14-9" aria-hidden="true" tabindex="-1"></a><span class="co"># # compute average density</span></span>
<span id="cb14-10"><a href="#cb14-10" aria-hidden="true" tabindex="-1"></a><span class="co"># avden = mean(DENSITY),</span></span>
<span id="cb14-11"><a href="#cb14-11" aria-hidden="true" tabindex="-1"></a><span class="co"># # compute stratum variance</span></span>
<span id="cb14-12"><a href="#cb14-12" aria-hidden="true" tabindex="-1"></a><span class="co"># svar = var(DENSITY),</span></span>
<span id="cb14-13"><a href="#cb14-13" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate N</span></span>
<span id="cb14-14"><a href="#cb14-14" aria-hidden="true" tabindex="-1"></a><span class="co"># n = length(DENSITY)) %>%</span></span>
<span id="cb14-15"><a href="#cb14-15" aria-hidden="true" tabindex="-1"></a><span class="co"># # convert 0 for stratum variance so that the sqrt is a small # but not a 0</span></span>
<span id="cb14-16"><a href="#cb14-16" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(svar = dplyr::case_when(svar == 0 ~ 0.00000001,</span></span>
<span id="cb14-17"><a href="#cb14-17" aria-hidden="true" tabindex="-1"></a><span class="co"># TRUE ~ svar)) %>%</span></span>
<span id="cb14-18"><a href="#cb14-18" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(std = sqrt(svar))</span></span>
<span id="cb14-19"><a href="#cb14-19" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb14-20"><a href="#cb14-20" aria-hidden="true" tabindex="-1"></a><span class="co"># density_est <- density_est %>%</span></span>
<span id="cb14-21"><a href="#cb14-21" aria-hidden="true" tabindex="-1"></a><span class="co"># # Merge ntot with coral_est_spp</span></span>
<span id="cb14-22"><a href="#cb14-22" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::full_join(., ntot) %>%</span></span>
<span id="cb14-23"><a href="#cb14-23" aria-hidden="true" tabindex="-1"></a><span class="co"># # stratum estimates</span></span>
<span id="cb14-24"><a href="#cb14-24" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(whavden = wh * avden,</span></span>
<span id="cb14-25"><a href="#cb14-25" aria-hidden="true" tabindex="-1"></a><span class="co"># whsvar = wh^2 * svar,</span></span>
<span id="cb14-26"><a href="#cb14-26" aria-hidden="true" tabindex="-1"></a><span class="co"># whstd = wh * std,</span></span>
<span id="cb14-27"><a href="#cb14-27" aria-hidden="true" tabindex="-1"></a><span class="co"># n = tidyr::replace_na(n, 0))</span></span>
<span id="cb14-28"><a href="#cb14-28" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb14-29"><a href="#cb14-29" aria-hidden="true" tabindex="-1"></a><span class="co"># # Reformat output</span></span>
<span id="cb14-30"><a href="#cb14-30" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb14-31"><a href="#cb14-31" aria-hidden="true" tabindex="-1"></a><span class="co"># density_strata <- density_est %>%</span></span>
<span id="cb14-32"><a href="#cb14-32" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::select(REGION, YEAR, ANALYSIS_STRATUM, STRAT, RUG_CD, PROT, NTOT, ngrtot, wh, n, avden, svar, std)</span></span>
<span id="cb14-33"><a href="#cb14-33" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb14-34"><a href="#cb14-34" aria-hidden="true" tabindex="-1"></a><span class="co"># # Calculate Domain Estimates</span></span>
<span id="cb14-35"><a href="#cb14-35" aria-hidden="true" tabindex="-1"></a><span class="co"># Domain_est <- density_est %>%</span></span>
<span id="cb14-36"><a href="#cb14-36" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(REGION, YEAR) %>%</span></span>
<span id="cb14-37"><a href="#cb14-37" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(avDen = sum(whavden),</span></span>
<span id="cb14-38"><a href="#cb14-38" aria-hidden="true" tabindex="-1"></a><span class="co"># var = sum(whsvar, na.rm = T),</span></span>
<span id="cb14-39"><a href="#cb14-39" aria-hidden="true" tabindex="-1"></a><span class="co"># std = sqrt(var),</span></span>
<span id="cb14-40"><a href="#cb14-40" aria-hidden="true" tabindex="-1"></a><span class="co"># ngrtot = sum(NTOT) )</span></span></code></pre></div>
<p>Example of weighting application for Caribbean:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Calculate average density (avden), stratum variance (svar), n and std at the strata and regional level using HABITAT + DEPTH_STRAT as the analysis strata. Inputdata = 1 stage site level coral density and ntot = the most recent NTOT file for the region, regardless of sampling year. </span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a><span class="co"># # Calculate avdns, svar, n and std</span></span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a><span class="co"># density_est <- inputdata %>%</span></span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a><span class="co"># # group by analysis level strata</span></span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(ANALYSIS_STRATUM = STRAT) %>%</span></span>
<span id="cb15-8"><a href="#cb15-8" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(YEAR, ANALYSIS_STRATUM, STRAT) %>% </span></span>
<span id="cb15-9"><a href="#cb15-9" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(# compute average density</span></span>
<span id="cb15-10"><a href="#cb15-10" aria-hidden="true" tabindex="-1"></a><span class="co"># avden = mean(DENSITY),</span></span>
<span id="cb15-11"><a href="#cb15-11" aria-hidden="true" tabindex="-1"></a><span class="co"># # compute stratum variance</span></span>
<span id="cb15-12"><a href="#cb15-12" aria-hidden="true" tabindex="-1"></a><span class="co"># svar = var(DENSITY),</span></span>
<span id="cb15-13"><a href="#cb15-13" aria-hidden="true" tabindex="-1"></a><span class="co"># # calculate N</span></span>
<span id="cb15-14"><a href="#cb15-14" aria-hidden="true" tabindex="-1"></a><span class="co"># n = length(DENSITY)) %>%</span></span>
<span id="cb15-15"><a href="#cb15-15" aria-hidden="true" tabindex="-1"></a><span class="co"># # convert 0 for stratum variance so that the sqrt is a small # but not a 0</span></span>
<span id="cb15-16"><a href="#cb15-16" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(svar = dplyr::case_when(svar == 0 ~ 0.00000001,</span></span>
<span id="cb15-17"><a href="#cb15-17" aria-hidden="true" tabindex="-1"></a><span class="co"># TRUE ~ svar)) %>%</span></span>
<span id="cb15-18"><a href="#cb15-18" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(std = sqrt(svar))</span></span>
<span id="cb15-19"><a href="#cb15-19" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb15-20"><a href="#cb15-20" aria-hidden="true" tabindex="-1"></a><span class="co"># density_est <- density_est %>%</span></span>
<span id="cb15-21"><a href="#cb15-21" aria-hidden="true" tabindex="-1"></a><span class="co"># # Merge ntot with coral_est_spp</span></span>
<span id="cb15-22"><a href="#cb15-22" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::full_join(., ntot) %>%</span></span>
<span id="cb15-23"><a href="#cb15-23" aria-hidden="true" tabindex="-1"></a><span class="co"># # stratum estimates</span></span>
<span id="cb15-24"><a href="#cb15-24" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::mutate(whavden = wh * avden,</span></span>
<span id="cb15-25"><a href="#cb15-25" aria-hidden="true" tabindex="-1"></a><span class="co"># whsvar = wh^2 * svar,</span></span>
<span id="cb15-26"><a href="#cb15-26" aria-hidden="true" tabindex="-1"></a><span class="co"># whstd = wh * std,</span></span>
<span id="cb15-27"><a href="#cb15-27" aria-hidden="true" tabindex="-1"></a><span class="co"># n = tidyr::replace_na(n, 0),</span></span>
<span id="cb15-28"><a href="#cb15-28" aria-hidden="true" tabindex="-1"></a><span class="co"># # Add the following to match FL format </span></span>
<span id="cb15-29"><a href="#cb15-29" aria-hidden="true" tabindex="-1"></a><span class="co"># PROT = NA, </span></span>
<span id="cb15-30"><a href="#cb15-30" aria-hidden="true" tabindex="-1"></a><span class="co"># RUG_CD = NA)</span></span>
<span id="cb15-31"><a href="#cb15-31" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb15-32"><a href="#cb15-32" aria-hidden="true" tabindex="-1"></a><span class="co"># # Reformat output</span></span>
<span id="cb15-33"><a href="#cb15-33" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb15-34"><a href="#cb15-34" aria-hidden="true" tabindex="-1"></a><span class="co"># density_strata <- density_est %>%</span></span>
<span id="cb15-35"><a href="#cb15-35" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::select(REGION, YEAR, ANALYSIS_STRATUM, STRAT, RUG_CD, PROT, NTOT, ngrtot, wh, n, avden, svar, std)</span></span>
<span id="cb15-36"><a href="#cb15-36" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb15-37"><a href="#cb15-37" aria-hidden="true" tabindex="-1"></a><span class="co"># # Calculate Domain Estimates</span></span>
<span id="cb15-38"><a href="#cb15-38" aria-hidden="true" tabindex="-1"></a><span class="co"># Domain_est <- density_est %>%</span></span>
<span id="cb15-39"><a href="#cb15-39" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::group_by(REGION, YEAR) %>%</span></span>
<span id="cb15-40"><a href="#cb15-40" aria-hidden="true" tabindex="-1"></a><span class="co"># dplyr::summarise(avDen = sum(whavden),</span></span>
<span id="cb15-41"><a href="#cb15-41" aria-hidden="true" tabindex="-1"></a><span class="co"># var = sum(whsvar, na.rm = T),</span></span>
<span id="cb15-42"><a href="#cb15-42" aria-hidden="true" tabindex="-1"></a><span class="co"># std = sqrt(var),</span></span>
<span id="cb15-43"><a href="#cb15-43" aria-hidden="true" tabindex="-1"></a><span class="co"># ngrtot = sum(NTOT) )</span></span></code></pre></div>
</div>
</div>
<div id="species-richness-and-diversity" class="section level2">
<h2>Species richness and diversity</h2>
<div id="ncrmp_drm_calculate_species_richness_diversity" class="section level3">
<h3>5. NCRMP_DRM_calculate_species_richness_diversity</h3>
<p><strong>Calculates species richness from site to regional level for all sampling years. Calculates Simpson, Inverse Simpson and Shannon–Wiener diversity indices from site to regional level for all sampling years using the R package vegan.</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP” (All regions), “NCRMP_DRM” (Florida regions only)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>species_list: a list of a species present for all sampling years</p></li>
<li><p>richness_site: site level species richness. Includes juveniles. Note there is no accouting for transect length/effort</p></li>
<li><p>richness_strata: strata level mean species richness (unweighted). Includes juveniles. Note there is no accouting for transect length/effort</p></li>
<li><p>Domain estimates: weighted regional (domain level) species richness. Includes juveniles. Note there is no accouting for transect length/effort</p></li>
<li><p>species_diversity_site: site level species diversity using the Simpson, Inverse Simpson and Shannon-Weiner diversity indices. Based only on adults since the abundance of juveniles is not recorded. Note there is no accouting for transect length/effort</p></li>
<li><p>species_diversity_strata: strata level species diversity using the Simpson, Inverse Simpson and Shannon-Weiner diversity indices (unweighted). Based only on adults since the abundance of juveniles is not recorded. Note there is no accouting for transect length/effort</p></li>
<li><p>species_diversity_region: weighted regional (domain level) species diversity using the Simpson, Inverse Simpson and Shannon-Weiner diversity indices. Based only on adults since the abundance of juveniles is not recorded. Note there is no accouting for transect length/effort</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb16-3"><a href="#cb16-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb16-4"><a href="#cb16-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb16-5"><a href="#cb16-5" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_calculate_species_richness_diversity</span>(<span class="at">project =</span> <span class="st">"NCRMP"</span>,</span>
<span id="cb16-6"><a href="#cb16-6" aria-hidden="true" tabindex="-1"></a> <span class="at">region=</span> <span class="st">"Tortugas"</span>)</span>
<span id="cb16-7"><a href="#cb16-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb16-8"><a href="#cb16-8" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb16-9"><a href="#cb16-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb16-10"><a href="#cb16-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb16-11"><a href="#cb16-11" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_spp_list <span class="ot"><-</span> tmp<span class="sc">$</span>species_list </span>
<span id="cb16-12"><a href="#cb16-12" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_richness_site <span class="ot"><-</span> tmp<span class="sc">$</span>richness_site</span>
<span id="cb16-13"><a href="#cb16-13" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_richness_strata <span class="ot"><-</span> tmp<span class="sc">$</span>richness_strata</span>
<span id="cb16-14"><a href="#cb16-14" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_richness_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est</span>
<span id="cb16-15"><a href="#cb16-15" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb16-16"><a href="#cb16-16" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_diversity_site <span class="ot"><-</span> tmp<span class="sc">$</span>species_diversity_site</span>
<span id="cb16-17"><a href="#cb16-17" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_diversity_strata <span class="ot"><-</span> tmp<span class="sc">$</span>diversity_strata</span>
<span id="cb16-18"><a href="#cb16-18" aria-hidden="true" tabindex="-1"></a>NCRMP_Tort_2014_22_diversity_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est_div</span></code></pre></div>
<p>Regional species richness and diversity are calculated using the same weighting scheme as coral density. See NCRMP_make_weighted_demo_data and NCRMP_make_weighted_demo_data_RC for example code. Only the default analysis strat settings are available for species diversity. See <a href="https://cran.r-project.org/web/packages/vegan/vegan.pdf" class="uri">https://cran.r-project.org/web/packages/vegan/vegan.pdf</a> for more information on the diversity indices.</p>
</div>
</div>
<div id="mortality" class="section level2">
<h2>Mortality</h2>
<div id="ncrmp_drm_calculate_mortality" class="section level3">
<h3>6. NCRMP_DRM_calculate_mortality</h3>
<p><strong>Calculates old and recent mortality (percent of colony surface) from species to regional level for all sampling years</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP” (All regions), “NCRMP_DRM” (Florida regions only)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>species_filter: A string indicating whether a region-specific preset species filter should be applied to density calculations (species codes in a list) or all species should be included (FALSE; the default). Generally not used as species-specific estimates are also provided by default.</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>old_mortality_site: site level old mortality (across all corals)</p></li>
<li><p>recent_mortality_site: site level recent mortality (across all corals)</p></li>
<li><p>old_mortality_strata: strata level mean old mortality (unweighted, across all corals)</p></li>
<li><p>rec_mortality_strata: strata level mean recent mortality (unweighted, across all corals)</p></li>
<li><p>old_mortality_species_strata: strata level mean old mortality (unweighted, by species)</p></li>
<li><p>rec_mortality_species_strata: strata level mean recent mortality (unweighted, by species)</p></li>
<li><p>Domain_est_old_mort: weighted regional (domain level) old mortality (across all species)</p></li>
<li><p>Domain_est_rec_mort: weighted regional (domain level) recent mortality (across all species)</p></li>
<li><p>Domain_est_old_mort_species: weighted regional (domain level) old mortality, by species. Not species-specific mortality weighting is based on strata where species is PRESENT</p></li>
<li><p>Domain_est_rec_mort_species: weighted regional (domain level) recent mortality, by species. Not species-specific mortality weighting is based on strata where species is PRESENT</p></li>
<li><p>ntot_check_rec_mort_species: QAQC check to ensure species-specific NTOT’s add up to 1</p></li>
<li><p>ntot_check_old_mort_species: QAQC check to ensure species-specific NTOT’s add up to 1</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-4"><a href="#cb17-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function</span></span>
<span id="cb17-5"><a href="#cb17-5" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_calculate_mortality</span>(<span class="at">project =</span> <span class="st">"NCRMP"</span>,</span>
<span id="cb17-6"><a href="#cb17-6" aria-hidden="true" tabindex="-1"></a> <span class="at">region =</span> <span class="st">"GOM"</span>,</span>
<span id="cb17-7"><a href="#cb17-7" aria-hidden="true" tabindex="-1"></a> <span class="at">species_filter =</span> <span class="st">"FALSE"</span>)</span>
<span id="cb17-8"><a href="#cb17-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-9"><a href="#cb17-9" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb17-10"><a href="#cb17-10" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename</span></span>
<span id="cb17-11"><a href="#cb17-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-12"><a href="#cb17-12" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_old_mort_site <span class="ot"><-</span> tmp<span class="sc">$</span>old_mortality_site</span>
<span id="cb17-13"><a href="#cb17-13" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_rec_mort_site <span class="ot"><-</span> tmp<span class="sc">$</span>recent_mortality_site</span>
<span id="cb17-14"><a href="#cb17-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-15"><a href="#cb17-15" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_old_mort_strata <span class="ot"><-</span> tmp<span class="sc">$</span>old_mortality_strata</span>
<span id="cb17-16"><a href="#cb17-16" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_rec_mort_strata <span class="ot"><-</span> tmp<span class="sc">$</span>rec_mortality_strata</span>
<span id="cb17-17"><a href="#cb17-17" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-18"><a href="#cb17-18" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_old_mort_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est_old_mort</span>
<span id="cb17-19"><a href="#cb17-19" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_rec_mort_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est_rec_mort</span>
<span id="cb17-20"><a href="#cb17-20" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-21"><a href="#cb17-21" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_old_mort_species_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est_old_mort_species</span>
<span id="cb17-22"><a href="#cb17-22" aria-hidden="true" tabindex="-1"></a>NCRMP_FGBNMS_2013_22_rec_mort_species_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est_rec_mort_species</span>
<span id="cb17-23"><a href="#cb17-23" aria-hidden="true" tabindex="-1"></a><span class="co"># check ntot weighting for species-specific mortality - should only be values of 1 (sum of weights across strata for each species in each year)</span></span>
<span id="cb17-24"><a href="#cb17-24" aria-hidden="true" tabindex="-1"></a><span class="fu">unique</span>(tmp<span class="sc">$</span>ntot_check_rec_mort_species<span class="sc">$</span>wh_sum)</span>
<span id="cb17-25"><a href="#cb17-25" aria-hidden="true" tabindex="-1"></a><span class="fu">unique</span>(tmp<span class="sc">$</span>ntot_check_old_mort_species<span class="sc">$</span>wh_sum)</span></code></pre></div>
<p>Regional old and recent mortality are calculated using the same weighting scheme as coral density. See NCRMP_make_weighted_demo_data for example code. Species-specific mortality estimates are done based on strata a species is PRESENT. See load_NTOT_species for code.</p>
</div>
</div>
<div id="invertebrate-density" class="section level2">
<h2>Invertebrate density</h2>
<div id="ncrmp_calculate_invert_density" class="section level3">
<h3>7. NCRMP_calculate_invert_density</h3>
<p><strong>Calculates <em>Diadema antillarum</em> density from site to regional level for all sampling years</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>project: “NCRMP” (default) or “MIR” (in development)</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>diadema_density_site: site level Diadema density</p></li>
<li><p>invert_strata: strata level mean Diadema density (unweighted)</p></li>
<li><p>Domain_est: weighted regional (domain level) Diadema density</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_invert_density</p>
<p>Example:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-5"><a href="#cb18-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb18-6"><a href="#cb18-6" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_calculate_invert_density</span>(<span class="at">region =</span> <span class="st">"PRICO"</span>, <span class="at">project =</span> <span class="st">"NCRMP"</span>)</span>
<span id="cb18-7"><a href="#cb18-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-8"><a href="#cb18-8" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb18-9"><a href="#cb18-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb18-10"><a href="#cb18-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-11"><a href="#cb18-11" aria-hidden="true" tabindex="-1"></a>NCRMP_PRICO_2014_21_invert_den_site <span class="ot"><-</span> tmp<span class="sc">$</span>diadema_density_site</span>
<span id="cb18-12"><a href="#cb18-12" aria-hidden="true" tabindex="-1"></a>NCRMP_PRICO_2014_21_invert_den_strata <span class="ot"><-</span> tmp<span class="sc">$</span>invert_strata <span class="co"># Right now just Diadema</span></span>
<span id="cb18-13"><a href="#cb18-13" aria-hidden="true" tabindex="-1"></a>NCRMP_PRICO_2014_21_invert_den_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est</span></code></pre></div>
<p>Regional <em>Diadema</em> density is calculated using the same weighting scheme as coral density. See NCRMP_make_weighted_invert_density for example code. This function is currently only calculating <em>Diadema</em> density. Future updates will include conch and lobster; but until these updates are complete, please see the code in this function for guidance on how to calculate density for the other invertebrates.</p>
</div>
</div>
<div id="diseasebleaching-prevalence" class="section level2">
<h2>Disease/bleaching prevalence</h2>
<div id="a.-ncrmp_drm_calculate_disease_prevalence_colonies" class="section level3">
<h3>8a. NCRMP_DRM_calculate_disease_prevalence_colonies</h3>
<p><strong>Calculates disease and bleaching prevalence at the site (% colonies per site), site and species (% colonies per site per species), strata (mean of % colonies per site), and regional (weighted mean of % colonies per site) level for all sampling years</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP_DRM” (Florida regions only), “NCRMP” (All regions)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>species_filter: A string indicating whether a region-specific preset species filter should be applied to density calculations (species codes in a list) or all species should be included (FALSE; the default). Note the species filter is not used as much as species-specific domain estimates are also provided.</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>dis_ble_prev_species: site and species level disease and bleaching prevalence</p></li>
<li><p>dis_ble_prev_site: site level disease and bleaching prevalence</p></li>
<li><p>dis_prev_strata: strata level disease prevalence (unweighted)</p></li>
<li><p>ble_prev_strata: strata level bleaching prevalence (unweighted)</p></li>
<li><p>Domain_est: weighted regional (domain level) disease and bleaching prevalence</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-4"><a href="#cb19-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb19-5"><a href="#cb19-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-6"><a href="#cb19-6" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_calculate_disease_prevalence_colonies</span>(<span class="at">project =</span> <span class="st">"NCRMP_DRM"</span>,</span>
<span id="cb19-7"><a href="#cb19-7" aria-hidden="true" tabindex="-1"></a> <span class="at">region =</span> <span class="st">"SEFCRI"</span>,</span>
<span id="cb19-8"><a href="#cb19-8" aria-hidden="true" tabindex="-1"></a> <span class="at">species_filter =</span> <span class="st">"FALSE"</span>)</span>
<span id="cb19-9"><a href="#cb19-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-10"><a href="#cb19-10" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb19-11"><a href="#cb19-11" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb19-12"><a href="#cb19-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-13"><a href="#cb19-13" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_SEFCRI_2014_22_dis_ble_prev_species <span class="ot"><-</span> tmp<span class="sc">$</span>dis_ble_prev_species</span>
<span id="cb19-14"><a href="#cb19-14" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_SEFCRI_2014_22_dis_ble_prev_site <span class="ot"><-</span> tmp<span class="sc">$</span>dis_ble_prev_site</span>
<span id="cb19-15"><a href="#cb19-15" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_SEFCRI_2014_22_dis_prev_strata <span class="ot"><-</span> tmp<span class="sc">$</span>dis_prev_strata</span>
<span id="cb19-16"><a href="#cb19-16" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_SEFCRI_2014_22_ble_prev_strata <span class="ot"><-</span> tmp<span class="sc">$</span>ble_prev_strata</span>
<span id="cb19-17"><a href="#cb19-17" aria-hidden="true" tabindex="-1"></a>NCRMP_DRM_SEFCRI_2014_22_dis_ble_prev_region <span class="ot"><-</span> tmp<span class="sc">$</span>Domain_est</span></code></pre></div>
<p>Regional disease prevalence are calculated using the same weighting scheme as coral density. See NCRMP_make_weighted_demo_data for example code.</p>
<p>Note: Disease was not sampled in the Flower Garden Banks National Marine Sanctuary (FGBNMS) in 2013</p>
</div>
<div id="b.-ncrmp_drm_calculate_dis_ble_prevalence_species_domain" class="section level3">
<h3>8b. NCRMP_DRM_calculate_dis_ble_prevalence_species_domain</h3>
<p><strong>Calculates disease and bleaching prevalence by species at the regional (weighted mean of % colonies per site) level for all sampling years. Note weighting is specific to the strata each species is present in, because disease prevalence is NA (not 0) in a strata where a species is absent</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP_DRM” (Florida regions only), “NCRMP” (All regions)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>species_filter: A string indicating whether a region-specific preset species filter should be applied to density calculations (species codes in a list) or all species should be included (FALSE; the default). Note the species filter is not used as much as species-specific domain estimates are also provided.</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>DomainEst_dis: weighted regional (domain level) disease prevalence by species</p></li>
<li><p>DomainEst_bl: weighted regional (domain level) bleaching prevalence by species</p></li>
<li><p>wh_total: QAQC check to ensure species-specific NTOT’s add up to 1</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb20-3"><a href="#cb20-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb20-4"><a href="#cb20-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb20-5"><a href="#cb20-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb20-6"><a href="#cb20-6" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_calculate_dis_ble_prevalence_species_domain</span>(<span class="at">project=</span><span class="st">"NCRMP"</span>,</span>
<span id="cb20-7"><a href="#cb20-7" aria-hidden="true" tabindex="-1"></a> <span class="at">region =</span> <span class="st">"STX"</span>)</span>
<span id="cb20-8"><a href="#cb20-8" aria-hidden="true" tabindex="-1"></a><span class="co"># ntot check - wh_total should always be 1 (sum of weights across strata for each species in each year)</span></span>
<span id="cb20-9"><a href="#cb20-9" aria-hidden="true" tabindex="-1"></a><span class="fu">unique</span>(tmp<span class="sc">$</span>ntot_check<span class="sc">$</span>wh_total)</span>
<span id="cb20-10"><a href="#cb20-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb20-11"><a href="#cb20-11" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb20-12"><a href="#cb20-12" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb20-13"><a href="#cb20-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb20-14"><a href="#cb20-14" aria-hidden="true" tabindex="-1"></a>NCRMP_STX_2015_21_dis_prev_species_region <span class="ot"><-</span> tmp<span class="sc">$</span>DomainEst_dis</span>
<span id="cb20-15"><a href="#cb20-15" aria-hidden="true" tabindex="-1"></a>NCRMP_STX_2015_21_ble_prev_species_region <span class="ot"><-</span> tmp<span class="sc">$</span>DomainEst_bl</span></code></pre></div>
</div>
<div id="c.-ncrmp_drm_calculate_disease_prevalence_sites" class="section level3">
<h3>8c. NCRMP_DRM_calculate_disease_prevalence_sites</h3>
<p><strong>Calculates number of sites with disease and bleaching at the strata and regional level for all sampling years</strong></p>
<ul>
<li><p>parameters:</p>
<ul>
<li><p>project: “NCRMP_DRM” (Florida regions only), “NCRMP” (All regions)</p></li>
<li><p>region: “SEFCRI”, “FLK”, “Tortugas”, “STTSTJ”, “STX”, “PRICO”, “GOM”</p></li>
<li><p>species_filter: A string indicating whether a region-specific preset species filter should be applied to density calculations (species codes in a list) or all species should be included (FALSE; the default). Note the species filter is not used as much as species-specific domain estimates are also provided.</p></li>
</ul></li>
<li><p>outputs (dataframes):</p>
<ul>
<li><p>dis_ble_prev_site: site level disease and bleaching presence</p></li>
<li><p>dis_ble_prev_strata: number of sites in each strata with disease and bleaching</p></li>
<li><p>disease_prev_region: number of sites across the region with disease and bleaching</p></li>
</ul></li>
</ul>
<p>Associated functions: NCRMP_make_weighted_demo_data</p>
<p>Example:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span>(ncrmp.benthics.analysis)</span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Run function </span></span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a>tmp <span class="ot"><-</span> <span class="fu">NCRMP_DRM_calculate_disease_prevalence_sites</span>(<span class="at">project =</span> <span class="st">"NCRMP"</span>,</span>
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true" tabindex="-1"></a> <span class="at">region =</span> <span class="st">"STTSTJ"</span>,</span>
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true" tabindex="-1"></a> <span class="at">species_filter =</span> <span class="st">"FALSE"</span>)</span>
<span id="cb21-9"><a href="#cb21-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb21-10"><a href="#cb21-10" aria-hidden="true" tabindex="-1"></a><span class="co"># The function will store all of the function outputs as a list in tmp</span></span>
<span id="cb21-11"><a href="#cb21-11" aria-hidden="true" tabindex="-1"></a><span class="co"># Convert list objects to dataframes and rename </span></span>
<span id="cb21-12"><a href="#cb21-12" aria-hidden="true" tabindex="-1"></a></span>