Warning: package 'ggplot2' was built under R version 4.3.2
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.3.2
Warning: package 'tidyr' was built under R version 4.3.2
Warning: package 'readr' was built under R version 4.3.2
Warning: package 'purrr' was built under R version 4.3.2
Warning: package 'dplyr' was built under R version 4.3.2
Warning: package 'forcats' was built under R version 4.3.2
Warning: package 'lubridate' was built under R version 4.3.2
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ lubridate 1.9.3 ✔ tibble 3.2.1
✔ purrr 1.0.2 ✔ tidyr 1.3.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
Final Project Part 4:
- datasets
- methods (where did data come from + how was it collected + sources)
- show it contains data to test the research questions
- how to test for the research questions
Data set vetting answers:Research questions + goals: - How does ocean chemistry affect hard coral cover in the Florida keys? - Analyze the relationship between ocean chemistry (pH, temperature, aragonite saturation) and the abundance of hard coral cover in 3 regions of Florida Keys (Florida Keys, Tortugas, SEFCRI)- How does hard coral cover vary over time within the Florida Keys? - Compare hard coral cover over time in Florida Keys (not split into region)- How does hard coral cover vary over time in each region of interest? - Compare hard coral cover over time within each region and in comparison to each region- How does hard coral cover of specific species change over time within each region and in comparison to each region? - Compare hard coral cover of species observed over time in each region - What are the trends in carbonate chemistry within each region and in comparison to each region? - Compare carbonate chemistry variables over time in each region Datasets:- Our benthic coral data and carbonate chemistry has the variables we want to analyze (all between 2016-2022)- Benthic coral data - focused on hard corals for now - regions (FLK (florida keys) DRT (tortugas) and SEFCRI (south east florida coral reef initiative)) - observations: DRT (1264) FLK (820) SEFCRI (276) - species (COVER_CAT_NAME) - filtered down to hard coral species with n>20 (18 species) - hard coral cover percentage (HARDBOTTOM_P)- Carbonate chemistry data - focused on pH + Temp + Aragonite saturation - FLK (florida keys) DRT (tortugas) and SEFCRI (south east florida coral reef initiative) - observations: DRT (158) FLK (2222) SEFCRI (48) - filtered down to: time, latitude, longitude, Region, Year, DIC, pH_measured, pH_calculated, pCO2, Aragonite_Sat, Temperature_CVisualizations: - Map of ΩAr, temperature, and pH across Florida Keys (start with ΩAr and maybe the other two)- Changes in % hard coral cover over time at each region and overall- Changes in aragonite saturation, temperature, and pH against coral cover Statistical Analysis: analyze BOTH datasets- Check variability- Model selection - Different sites species diversity or coral cover over time (ANOVA)- Different sites coral cover over time looking at different chemistry variables (ANOVA)- Compare carbonate chemistry with (mixed modeling)- Compare coral and algal cover with (mixed modeling)- 95% CI for different mixed models - PCoA?Dataset information:We are using two data sets: CRCP carbonate chemistry and CRCP Benthic cover andboth of these data are sourced from NOAA (National Oceanic and AtmosphericAdministration). The carbonate chemistry data set contains differentmeasurements taken at long-term monitoring sites in the Atlantic by NOAA NCRMP(National Coral Reef Monitoring Program) and includes variables like dissolvedinorganic carbon, total alkalinity, and other carbonate chemistry relatedmeasurements. Monitoring sites included locations in the US Virgin Islands (St.Croix, St. John, and St. Thomas), the Florida Keys, Puerto Rico, Flower GardenBanks (Texas), and Dry Tortugas (Florida). Water samples for carbonatechemistry analysis were collected in two ways: active sampling done by SCUBAdivers during research excursions at monitoring sites and using sub automaticwater samplers, which took samples at 15 meters deep. The samples were broughtback to the lab and analyzed to get TA and DIC, which is combined withtemperature, depth, and salinity to inform other important carbonate chemistryvariables (e.g. pH, aragonite saturation, pCO2– all of which are also reportedin the data set). The benthic monitoring data also comes out of surveys done by NCRMP to assessreef health throughout Florida and data is collected in two ways: BenthicAssessment and the Coral Demographic. The Benthic Assessment gives an estimateof cover types that are considered ecologically important, which containsgroups like macroalgae, crustose coralline algae, san, coral, etc.,. Data fromthese surveys are collected by divers at randomly selected transects at eachsite and surveys were collected at 30 meters deep. The goal of which is tounderstand percent cover of benthic species, rugosity at each location, assessecologically important invertebrates (e.g. urchins, lobster, queen conchetc.,), and assess presence and absence of ESA listed corals. For the CoralDemographic method, surveys were measured by 10m x 1m belt transects that wereplaced at random reef habitats. These surveys report information on speciessuch as density, size, abundance, diversity, and condition (e.g. live vs dead,bleaching, diseased etc.,).
# 2360 observations for all hard coral species included# locations = FLK (florida keys) DRT (tortugas) and SEFCRI (south east florida coral reef initiative)count_location <- coral1 |>group_by(REGION) |>summarise(count =n())count_location
# A tibble: 3 × 2
REGION count
<chr> <int>
1 DRT 1264
2 FLK 820
3 SEFCRI 276
time latitude longitude CTDID Region Year
1 2017-01-05T13:40:00Z 24.90518333 -80.6266 CalVal_Jan2017_1 FLK 2017
2 2017-01-05T13:55:00Z 24.89826667 -80.61738333 CalVal_Jan2017_2 FLK 2017
3 2017-01-05T14:05:00Z 24.89818333 -80.61606667 CalVal_Jan2017_3 FLK 2017
4 2017-01-05T14:17:00Z 24.8977 -80.61816667 CalVal_Jan2017_4 FLK 2017
5 2017-01-05T14:17:00Z 24.8977 -80.61816667 CalVal_Jan2017_5 FLK 2017
6 2017-01-05T14:27:00Z 24.89663333 -80.6153 CalVal_Jan2017_6 FLK 2017
Mission Location UTCDate UTCTime Date_UTC Sample_Depth_m
1 CalVal FLK 1/5/2017 13:40 2017-01-05T13:40:00Z 0
2 CalVal FLK 1/5/2017 13:55 2017-01-05T13:55:00Z 0
3 CalVal FLK 1/5/2017 14:05 2017-01-05T14:05:00Z 0
4 CalVal FLK 1/5/2017 14:17 2017-01-05T14:17:00Z 0
5 CalVal FLK 1/5/2017 14:17 2017-01-05T14:17:00Z 0
6 CalVal FLK 1/5/2017 14:27 2017-01-05T14:27:00Z 0
DIC TA pH_measured pH_calculated pCO2 Aragonite_Sat
1 2123.014035 2411.608632 7.994548 NaN 475.2770518 3.268880
2 2140.529652 2420.513021 7.978449 NaN 498.9336095 3.187039
3 2126.982858 2410.647741 7.986262 NaN 486.1758318 3.218789
4 2145.016273 2422.22993 7.972165 NaN 508.0844039 3.162853
5 2143.278035 2420.021861 7.971244 NaN 508.7680168 3.155604
6 2119.951218 2421.537582 8.014780 NaN 450.9955019 3.405095
Calcdsalinity Salinity_Bottle Conductivity_Sm Salinity_CTD Temperature_C
1 NaN 36.56578472 NaN 34.4 24.7
2 NaN 36.57792046 NaN 34.5 24.7
3 NaN 36.56840415 NaN 34.6 24.7
4 NaN 36.56089414 NaN 34.6 24.8
5 NaN 36.59590795 NaN 34.6 24.8
6 NaN 36.57137189 NaN 34.7 24.7
Pressure_db Density_Sigmat SiteID Survey_design Sample_frequency Notes
1 NaN NaN Transect 1 Permanent Single
2 NaN NaN CalVal N Permanent Single
3 NaN NaN ADCP NE Permanent Single
4 NaN NaN Map CO2 Buoy Permanent Single
5 NaN NaN Map CO2 Buoy Permanent Single
6 NaN NaN CalVal SE Permanent Single
accession_url
1 https://accession.nodc.noaa.gov/0162411
2 https://accession.nodc.noaa.gov/0162411
3 https://accession.nodc.noaa.gov/0162411
4 https://accession.nodc.noaa.gov/0162411
5 https://accession.nodc.noaa.gov/0162411
6 https://accession.nodc.noaa.gov/0162411
summary(carb1)
time latitude longitude CTDID
Length:2428 Length:2428 Length:2428 Length:2428
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
Region Year Mission Location
Length:2428 Min. :2015 Length:2428 Length:2428
Class :character 1st Qu.:2017 Class :character Class :character
Mode :character Median :2018 Mode :character Mode :character
Mean :2019
3rd Qu.:2020
Max. :2022
UTCDate UTCTime Date_UTC Sample_Depth_m
Length:2428 Length:2428 Length:2428 Length:2428
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
DIC TA pH_measured pH_calculated
Length:2428 Length:2428 Min. :7.319 Min. :7.670
Class :character Class :character 1st Qu.:8.002 1st Qu.:7.970
Mode :character Mode :character Median :8.038 Median :8.009
Mean :8.032 Mean :8.003
3rd Qu.:8.070 3rd Qu.:8.045
Max. :8.372 Max. :8.203
NA's :43 NA's :1591
pCO2 Aragonite_Sat Calcdsalinity Salinity_Bottle
Length:2428 Min. :1.025 Length:2428 Length:2428
Class :character 1st Qu.:3.473 Class :character Class :character
Mode :character Median :3.720 Mode :character Mode :character
Mean :3.687
3rd Qu.:3.930
Max. :5.342
NA's :28
Conductivity_Sm Salinity_CTD Temperature_C Pressure_db
Length:2428 Length:2428 Length:2428 Length:2428
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
Density_Sigmat SiteID Survey_design Sample_frequency
Length:2428 Length:2428 Length:2428 Length:2428
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
Notes accession_url
Length:2428 Length:2428
Class :character Class :character
Mode :character Mode :character
# 2016-2022# summary stats looking at data in each year + regionds2_chem <- carb1 |>group_by(Year, Region,na.rm =TRUE) |>summarise(n =n(),mean_PH =mean(pH_measured, na.rm=TRUE),mean_Temp =mean(Temperature_C, na.rm=TRUE),mean_AS =mean(Aragonite_Sat, na.rm=TRUE))
`summarise()` has grouped output by 'Year', 'Region'. You can override using
the `.groups` argument.