Data Used

How the raw data was wrangled

kable(head(raw.data))%>%
  kable_styling(bootstrap_options = "striped")
Tag # Date Actual_Date Processed Days Since Last Record Bleaching 8+ Wk (56 days) Success? Total Coral Area 1 (cm2) Total Coral Area 2 (cm2) Total Coral Area 3 (cm2) Total Coral Area 4 (cm2) Total Coral Area Sum (cm2) Live Tissue 1 (cm2) Live Tissue 2 (cm2) Live Tissue 3 (cm2) Live Tissue 4 (cm2) Live Tissue Sum (cm2) New SCTLD Mortality 1 (cm2) New SCTLD Mortality 2 (cm2) New SCTLD Mortality 3 (cm2) New SCTLD Mortality 4 (cm2) New SCTLD Mortality Sum (cm2) Other Recent Mortality (cm2) # New Lesions (count) # Total Active Lesions (count) Halted Lesions (count) Greatest Lesion Expansion (cm) Acute Lesions Present? (yes/no) Treatment Used (mL/cc) Change in Live Tissue (-/+ cm2) Rate of Change in Live Tissue (cm2/day) Lesion Progression (-/+ cm2) Rate of Lesion Progression (cm2/day) % New SCTLD Mort of Total Trying %/days for rate Notes
901 2022-06-03 6/3/22 Y 0 NA N 514.7 218.9 313.70000000000005 213.7 1261.0 413.3 15.6 216.4 143.19999999999999 788.5 26.5 1.4 17.899999999999999 2.8 48.6 na 0 1 0 8.69 Yes 6 NA NA NA NA 3.854084 NA NA
901 2022-07-20 7/20/22 Y 47 NA N 531.0 192.5 242.9 134.69999999999999 1101.1 397.2 12.1 124 100.4 633.7 0.0 0 0 0 0.0 na 0 0 1 0.00 No 3 -154.8 -3.293617 -48.6 -1.034043 0.000000 0 NA
901 2022-08-11 8/11/22 Y 22 NA Y 508.5 225.2 206.7 136.5 1076.9 343.2 16.5 104.6 39.700000000000003 504.0 0.0 0 0 0 0.0 na 0 0 1 0.00 No 0 -129.7 -5.895454 0.0 0.000000 0.000000 0 NA
901 2022-10-11 10/11/22 Y 61 NA Y 346.4 152.30000000000001 88.5 171.9 759.1 245.8 7 40.4 87.9 381.1 0.0 0 0 0 0.0 na 0 0 1 0.00 No 0 -122.9 -2.014754 0.0 0.000000 0.000000 0 NA
901 2022-11-15 11/15/22 Y 35 NA Y NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 0 NA NA NA NA NA NA NA
901 2023-01-11 1/11/23 Y 57 NA Y 573.0 200.20000000000002 241.5 327.10000000000002 1341.8 402.8 12.8 95.9 175.4 686.9 0.0 0 0 0 0.0 na 0 0 1 0.00 No 0 305.8 5.364912 0.0 0.000000 0.000000 0 NA

This table is the first 10 rows of the raw data used in this project. It was full of zeros that represented unanalyzed data, as well as columns that belonged in metadata.

percentages <- raw.data %>%
  select("Tag #",
         "Actual_Date",
         "Total Coral Area Sum (cm2)",
         "Live Tissue Sum (cm2)",
         "New SCTLD Mortality Sum (cm2)",
         "Treatment Used (mL/cc)")%>%
  rename("Date" = "Actual_Date",
         "Tag" = "Tag #",
         "Total_Coral_Area" = "Total Coral Area Sum (cm2)",
         "Live_Tissue" = "Live Tissue Sum (cm2)",
         "New_SCTLD_Mortality" = "New SCTLD Mortality Sum (cm2)",
         "Treatment" = "Treatment Used (mL/cc)")%>%
  na.omit()%>%
  mutate(Date = mdy(Date),
         Percent_Live = Live_Tissue / Total_Coral_Area,
         Percent_NewMort = New_SCTLD_Mortality / Total_Coral_Area,
         Tag = as.factor(Tag))

kable(head(percentages))%>%
  kable_styling(bootstrap_options = "striped")
Tag Date Total_Coral_Area Live_Tissue New_SCTLD_Mortality Treatment Percent_Live Percent_NewMort
901 2022-06-03 1261.0 788.5 48.6 6 0.6252974 0.0385408
901 2022-07-20 1101.1 633.7 0.0 3 0.5755154 0.0000000
901 2022-08-11 1076.9 504.0 0.0 0 0.4680100 0.0000000
901 2022-10-11 759.1 381.1 0.0 0 0.5020419 0.0000000
901 2023-01-11 1341.8 686.9 0.0 0 0.5119243 0.0000000
901 2023-06-20 1147.0 617.7 0.0 0 0.5385353 0.0000000

This table was created to analyze the rate of change in each colonies live tissue and active mortality over time.

counts <- raw.data %>%
  select("Tag #", 
         "Actual_Date",
         "# New Lesions (count)",
         "# Total Active Lesions (count)",
         "Halted Lesions (count)",
         "Treatment Used (mL/cc)")%>%
  rename("Date" = "Actual_Date",
         "Tag" = "Tag #",
         "New_Lesions" = "# New Lesions (count)",
         "Total_Active_Lesions" = "# Total Active Lesions (count)",
         "Halted_Lesions" = "Halted Lesions (count)",
         "Treatment_Used" = "Treatment Used (mL/cc)")%>%
  na.omit()%>%
  mutate(Date = mdy(Date),
         Tag = as.factor(Tag))

kable(head(counts))%>%
  kable_styling(bootstrap_options = "striped")
Tag Date New_Lesions Total_Active_Lesions Halted_Lesions Treatment_Used
901 2022-06-03 0 1 0 6
901 2022-07-20 0 0 1 3
901 2022-08-11 0 0 1 0
901 2022-10-11 0 0 1 0
901 2023-01-11 0 0 1 0
901 2023-06-20 0 0 1 0

This table was created to show the changes in number of active and halted diseased lesion on each colony over time.

Visualization

Graph showing live tissue and new mortality

Colony_Tag_Number <- hcl.colors(10, palette = "Roma", alpha = NULL)

plots <- function(data, x, y, z){
  p <- ggplot(data, aes({{x}},{{y}}, color = {{z}})) +
    geom_point() + 
    geom_line() +
    scale_color_carto_d("Colony_Tag_Number")
  
  return(p)
}

LiveT <- plots(percentages, Date, Percent_Live, Tag)

NewM <- plots(percentages, Date, Percent_NewMort, Tag)

NewL <- plots(counts, Date, New_Lesions, Tag)

ActiveL <- plots(counts, Date, Total_Active_Lesions, Tag)

HaltedL <- plots(counts, Date, Halted_Lesions, Tag)

Treatment <- plots(percentages, Date, Treatment, Tag)

tissue <- LiveT + NewM + Treatment + plot_layout(guides = "collect")
tissue 

Visualization

Graph showing live tissue and new mortality

lesions <- ActiveL + HaltedL + Treatment + plot_layout(guides = "collect")
print(lesions)