diff --git a/PPT.pptx b/PPT.pptx new file mode 100644 index 0000000..8d65f53 Binary files /dev/null and b/PPT.pptx differ diff --git a/indicator_data/RVC/RUVdensity_PRICO_BAL VETU.RData b/indicator_data/RVC/RUVdensity_PRICO_BAL VETU.RData index fa2e863..8f99a9f 100644 Binary files a/indicator_data/RVC/RUVdensity_PRICO_BAL VETU.RData and b/indicator_data/RVC/RUVdensity_PRICO_BAL VETU.RData differ diff --git a/indicator_data/RVC/RUVdensity_PRICO_EPI GUTT.RData b/indicator_data/RVC/RUVdensity_PRICO_EPI GUTT.RData index 462138a..27393b3 100644 Binary files a/indicator_data/RVC/RUVdensity_PRICO_EPI GUTT.RData and b/indicator_data/RVC/RUVdensity_PRICO_EPI GUTT.RData differ diff --git a/indicator_data/RVC/RUVdensity_PRICO_LUT ANAL.RData b/indicator_data/RVC/RUVdensity_PRICO_LUT ANAL.RData index f8d0dfe..2fa52a6 100644 Binary files a/indicator_data/RVC/RUVdensity_PRICO_LUT ANAL.RData and b/indicator_data/RVC/RUVdensity_PRICO_LUT ANAL.RData differ diff --git a/indicator_data/RVC/RUVdensity_PRICO_OCY CHRY.RData b/indicator_data/RVC/RUVdensity_PRICO_OCY CHRY.RData index 78659d1..9e07aec 100644 Binary files a/indicator_data/RVC/RUVdensity_PRICO_OCY CHRY.RData and b/indicator_data/RVC/RUVdensity_PRICO_OCY CHRY.RData differ diff --git a/indicator_data/RVC/RUVdensity_PRICO_SPA AURO.RData b/indicator_data/RVC/RUVdensity_PRICO_SPA AURO.RData index aaafccd..b2177d4 100644 Binary files a/indicator_data/RVC/RUVdensity_PRICO_SPA AURO.RData and b/indicator_data/RVC/RUVdensity_PRICO_SPA AURO.RData differ diff --git a/indicator_data/RVC/RUVdensity_PRICO_SPA VIRI.RData b/indicator_data/RVC/RUVdensity_PRICO_SPA VIRI.RData index 29ad340..1d6e5df 100644 Binary files a/indicator_data/RVC/RUVdensity_PRICO_SPA VIRI.RData and b/indicator_data/RVC/RUVdensity_PRICO_SPA VIRI.RData differ diff --git a/indicator_data/RVC/RUVdensity_STTSTJ_BAL VETU.RData b/indicator_data/RVC/RUVdensity_STTSTJ_BAL VETU.RData index e0cd6e5..23f6eb6 100644 Binary files a/indicator_data/RVC/RUVdensity_STTSTJ_BAL VETU.RData and b/indicator_data/RVC/RUVdensity_STTSTJ_BAL VETU.RData differ diff --git a/indicator_data/RVC/RUVdensity_STTSTJ_EPI GUTT.RData b/indicator_data/RVC/RUVdensity_STTSTJ_EPI GUTT.RData index 9df360a..4399072 100644 Binary files a/indicator_data/RVC/RUVdensity_STTSTJ_EPI GUTT.RData and b/indicator_data/RVC/RUVdensity_STTSTJ_EPI GUTT.RData differ diff --git a/indicator_data/RVC/RUVdensity_STTSTJ_LUT ANAL.RData b/indicator_data/RVC/RUVdensity_STTSTJ_LUT ANAL.RData index 8e0b80e..d354270 100644 Binary files a/indicator_data/RVC/RUVdensity_STTSTJ_LUT ANAL.RData and b/indicator_data/RVC/RUVdensity_STTSTJ_LUT ANAL.RData differ diff --git a/indicator_data/RVC/RUVdensity_STTSTJ_OCY CHRY.RData b/indicator_data/RVC/RUVdensity_STTSTJ_OCY CHRY.RData index 9c67936..16e812d 100644 Binary files a/indicator_data/RVC/RUVdensity_STTSTJ_OCY CHRY.RData and b/indicator_data/RVC/RUVdensity_STTSTJ_OCY CHRY.RData differ diff --git a/indicator_data/RVC/RUVdensity_STTSTJ_SPA AURO.RData b/indicator_data/RVC/RUVdensity_STTSTJ_SPA AURO.RData index 53186fe..48cbac9 100644 Binary files a/indicator_data/RVC/RUVdensity_STTSTJ_SPA AURO.RData and b/indicator_data/RVC/RUVdensity_STTSTJ_SPA AURO.RData differ diff --git a/indicator_data/RVC/RUVdensity_STTSTJ_SPA VIRI.RData b/indicator_data/RVC/RUVdensity_STTSTJ_SPA VIRI.RData index 1b0221d..45f2b8d 100644 Binary files a/indicator_data/RVC/RUVdensity_STTSTJ_SPA VIRI.RData and b/indicator_data/RVC/RUVdensity_STTSTJ_SPA VIRI.RData differ diff --git a/indicator_data/RVC/RUVdensity_STX_BAL VETU.RData b/indicator_data/RVC/RUVdensity_STX_BAL VETU.RData index 920d899..b3a4aa9 100644 Binary files a/indicator_data/RVC/RUVdensity_STX_BAL VETU.RData and b/indicator_data/RVC/RUVdensity_STX_BAL VETU.RData differ diff --git a/indicator_data/RVC/RUVdensity_STX_EPI GUTT.RData b/indicator_data/RVC/RUVdensity_STX_EPI GUTT.RData index b9584ed..d14910f 100644 Binary files a/indicator_data/RVC/RUVdensity_STX_EPI GUTT.RData and b/indicator_data/RVC/RUVdensity_STX_EPI GUTT.RData differ diff --git a/indicator_data/RVC/RUVdensity_STX_LUT ANAL.RData b/indicator_data/RVC/RUVdensity_STX_LUT ANAL.RData index 2a60240..b187232 100644 Binary files a/indicator_data/RVC/RUVdensity_STX_LUT ANAL.RData and b/indicator_data/RVC/RUVdensity_STX_LUT ANAL.RData differ diff --git a/indicator_data/RVC/RUVdensity_STX_OCY CHRY.RData b/indicator_data/RVC/RUVdensity_STX_OCY CHRY.RData index aaa2708..f9330b4 100644 Binary files a/indicator_data/RVC/RUVdensity_STX_OCY CHRY.RData and b/indicator_data/RVC/RUVdensity_STX_OCY CHRY.RData differ diff --git a/indicator_data/RVC/RUVdensity_STX_SPA AURO.RData b/indicator_data/RVC/RUVdensity_STX_SPA AURO.RData index 87b0635..bd5c574 100644 Binary files a/indicator_data/RVC/RUVdensity_STX_SPA AURO.RData and b/indicator_data/RVC/RUVdensity_STX_SPA AURO.RData differ diff --git a/indicator_data/RVC/RUVdensity_STX_SPA VIRI.RData b/indicator_data/RVC/RUVdensity_STX_SPA VIRI.RData index 87a8eaa..56a3a12 100644 Binary files a/indicator_data/RVC/RUVdensity_STX_SPA VIRI.RData and b/indicator_data/RVC/RUVdensity_STX_SPA VIRI.RData differ diff --git a/indicator_objects/avgLmax.RData b/indicator_objects/avgLmax.RData new file mode 100644 index 0000000..9ce1540 Binary files /dev/null and b/indicator_objects/avgLmax.RData differ diff --git a/indicator_objects/tier3.RData b/indicator_objects/tier3.RData index 1d33dac..3741318 100644 Binary files a/indicator_objects/tier3.RData and b/indicator_objects/tier3.RData differ diff --git a/indicator_objects/turbidity.RData b/indicator_objects/turbidity.RData index 4132814..c857b0c 100644 Binary files a/indicator_objects/turbidity.RData and b/indicator_objects/turbidity.RData differ diff --git a/indicator_plots/ACEindex_plot.png b/indicator_plots/ACEindex_plot.png index c6db511..7d9e664 100644 Binary files a/indicator_plots/ACEindex_plot.png and b/indicator_plots/ACEindex_plot.png differ diff --git a/indicator_plots/ACEindex_plot_wide.png b/indicator_plots/ACEindex_plot_wide.png new file mode 100644 index 0000000..2e2a284 Binary files /dev/null and b/indicator_plots/ACEindex_plot_wide.png differ diff --git a/indicator_plots/Carib_SST_plot.png b/indicator_plots/Carib_SST_plot.png index 77af07b..8722f05 100644 Binary files a/indicator_plots/Carib_SST_plot.png and b/indicator_plots/Carib_SST_plot.png differ diff --git a/indicator_plots/Carib_SST_plot_TAP.png b/indicator_plots/Carib_SST_plot_TAP.png new file mode 100644 index 0000000..db08be5 Binary files /dev/null and b/indicator_plots/Carib_SST_plot_TAP.png differ diff --git a/indicator_plots/DegreeHeatingWeeks_plot.png b/indicator_plots/DegreeHeatingWeeks_plot.png index 3fa5448..e67f5fe 100644 Binary files a/indicator_plots/DegreeHeatingWeeks_plot.png and b/indicator_plots/DegreeHeatingWeeks_plot.png differ diff --git a/indicator_plots/GDP_plot.png b/indicator_plots/GDP_plot.png index 32bfa43..c054568 100644 Binary files a/indicator_plots/GDP_plot.png and b/indicator_plots/GDP_plot.png differ diff --git a/indicator_plots/OA_plot.png b/indicator_plots/OA_plot.png index e390778..7f8c215 100644 Binary files a/indicator_plots/OA_plot.png and b/indicator_plots/OA_plot.png differ diff --git a/indicator_plots/OA_plot_wide.png b/indicator_plots/OA_plot_wide.png new file mode 100644 index 0000000..db9e2d8 Binary files /dev/null and b/indicator_plots/OA_plot_wide.png differ diff --git a/indicator_plots/PD_ratio_plot.png b/indicator_plots/PD_ratio_plot.png index 0a30644..e993e48 100644 Binary files a/indicator_plots/PD_ratio_plot.png and b/indicator_plots/PD_ratio_plot.png differ diff --git a/indicator_plots/PR_Lmax_classes_plot.png b/indicator_plots/PR_Lmax_classes_plot.png index c5ea93f..5be4b6f 100644 Binary files a/indicator_plots/PR_Lmax_classes_plot.png and b/indicator_plots/PR_Lmax_classes_plot.png differ diff --git a/indicator_plots/PR_Lmax_classes_plot_wide.png b/indicator_plots/PR_Lmax_classes_plot_wide.png new file mode 100644 index 0000000..0a42168 Binary files /dev/null and b/indicator_plots/PR_Lmax_classes_plot_wide.png differ diff --git a/indicator_plots/RVC_PR_plot.png b/indicator_plots/RVC_PR_plot.png index b557cb8..3edd423 100644 Binary files a/indicator_plots/RVC_PR_plot.png and b/indicator_plots/RVC_PR_plot.png differ diff --git a/indicator_plots/RVC_STSJ_plot.png b/indicator_plots/RVC_STSJ_plot.png index 41528ff..bb7e6ee 100644 Binary files a/indicator_plots/RVC_STSJ_plot.png and b/indicator_plots/RVC_STSJ_plot.png differ diff --git a/indicator_plots/RVC_STX_plot.png b/indicator_plots/RVC_STX_plot.png index 316d3b8..2af54bf 100644 Binary files a/indicator_plots/RVC_STX_plot.png and b/indicator_plots/RVC_STX_plot.png differ diff --git a/indicator_plots/STT_Lmax_classes_plot.png b/indicator_plots/STT_Lmax_classes_plot.png index 2081780..ce2011a 100644 Binary files a/indicator_plots/STT_Lmax_classes_plot.png and b/indicator_plots/STT_Lmax_classes_plot.png differ diff --git a/indicator_plots/STT_Lmax_classes_plot_wide.png b/indicator_plots/STT_Lmax_classes_plot_wide.png new file mode 100644 index 0000000..818e467 Binary files /dev/null and b/indicator_plots/STT_Lmax_classes_plot_wide.png differ diff --git a/indicator_plots/Sargassum_plot.png b/indicator_plots/Sargassum_plot.png index 8f7086e..1d5a031 100644 Binary files a/indicator_plots/Sargassum_plot.png and b/indicator_plots/Sargassum_plot.png differ diff --git a/indicator_plots/Sargassum_plot_wide.png b/indicator_plots/Sargassum_plot_wide.png new file mode 100644 index 0000000..22d309c Binary files /dev/null and b/indicator_plots/Sargassum_plot_wide.png differ diff --git a/indicator_plots/avgLmax_plot_TAP.png b/indicator_plots/avgLmax_plot_TAP.png new file mode 100644 index 0000000..52d43c3 Binary files /dev/null and b/indicator_plots/avgLmax_plot_TAP.png differ diff --git a/indicator_plots/carib_Chl_plot.png b/indicator_plots/carib_Chl_plot.png index 6dc6184..5c4fbd2 100644 Binary files a/indicator_plots/carib_Chl_plot.png and b/indicator_plots/carib_Chl_plot.png differ diff --git a/indicator_plots/carib_Chl_plot_wide.png b/indicator_plots/carib_Chl_plot_wide.png new file mode 100644 index 0000000..d699316 Binary files /dev/null and b/indicator_plots/carib_Chl_plot_wide.png differ diff --git a/indicator_plots/coral_spprichness_cover_plot.png b/indicator_plots/coral_spprichness_cover_plot.png index 882149b..496498e 100644 Binary files a/indicator_plots/coral_spprichness_cover_plot.png and b/indicator_plots/coral_spprichness_cover_plot.png differ diff --git a/indicator_plots/cruise_plot.png b/indicator_plots/cruise_plot.png new file mode 100644 index 0000000..8e392b3 Binary files /dev/null and b/indicator_plots/cruise_plot.png differ diff --git a/indicator_plots/cruise_plot_TAP.png b/indicator_plots/cruise_plot_TAP.png new file mode 100644 index 0000000..061fcc0 Binary files /dev/null and b/indicator_plots/cruise_plot_TAP.png differ diff --git a/indicator_plots/disturbance_plot.png b/indicator_plots/disturbance_plot.png index a79f246..1753098 100644 Binary files a/indicator_plots/disturbance_plot.png and b/indicator_plots/disturbance_plot.png differ diff --git a/indicator_plots/disturbance_plot_TAP.png b/indicator_plots/disturbance_plot_TAP.png new file mode 100644 index 0000000..5b1fa4f Binary files /dev/null and b/indicator_plots/disturbance_plot_TAP.png differ diff --git a/indicator_plots/earthquakes_plot.png b/indicator_plots/earthquakes_plot.png index 3343366..6b579c6 100644 Binary files a/indicator_plots/earthquakes_plot.png and b/indicator_plots/earthquakes_plot.png differ diff --git a/indicator_plots/earthquakes_plot_wide.png b/indicator_plots/earthquakes_plot_wide.png new file mode 100644 index 0000000..5ced804 Binary files /dev/null and b/indicator_plots/earthquakes_plot_wide.png differ diff --git a/indicator_plots/fish_density_plot.png b/indicator_plots/fish_density_plot.png index f6c5ab2..102e888 100644 Binary files a/indicator_plots/fish_density_plot.png and b/indicator_plots/fish_density_plot.png differ diff --git a/indicator_plots/fish_density_plot_TAP.png b/indicator_plots/fish_density_plot_TAP.png new file mode 100644 index 0000000..3246239 Binary files /dev/null and b/indicator_plots/fish_density_plot_TAP.png differ diff --git a/indicator_plots/gini_plot.png b/indicator_plots/gini_plot.png index 65b7914..fe2bcc6 100644 Binary files a/indicator_plots/gini_plot.png and b/indicator_plots/gini_plot.png differ diff --git a/indicator_plots/gini_plot_TAP.png b/indicator_plots/gini_plot_TAP.png new file mode 100644 index 0000000..0ba814d Binary files /dev/null and b/indicator_plots/gini_plot_TAP.png differ diff --git a/indicator_plots/marine_debris_plot.png b/indicator_plots/marine_debris_plot.png index 483a9fa..4060248 100644 Binary files a/indicator_plots/marine_debris_plot.png and b/indicator_plots/marine_debris_plot.png differ diff --git a/indicator_plots/marine_debris_plot_wide.png b/indicator_plots/marine_debris_plot_wide.png new file mode 100644 index 0000000..52602cd Binary files /dev/null and b/indicator_plots/marine_debris_plot_wide.png differ diff --git a/indicator_plots/oceanNAICS_plot.png b/indicator_plots/oceanNAICS_plot.png index 7b9208f..30db2c0 100644 Binary files a/indicator_plots/oceanNAICS_plot.png and b/indicator_plots/oceanNAICS_plot.png differ diff --git a/indicator_plots/Accumulated cyclone energy index.png b/indicator_plots/old plots/Accumulated cyclone energy index.png similarity index 100% rename from indicator_plots/Accumulated cyclone energy index.png rename to indicator_plots/old plots/Accumulated cyclone energy index.png diff --git a/indicator_plots/Annual mean sargassum innundation.png b/indicator_plots/old plots/Annual mean sargassum innundation.png similarity index 100% rename from indicator_plots/Annual mean sargassum innundation.png rename to indicator_plots/old plots/Annual mean sargassum innundation.png diff --git a/indicator_plots/Average monthly degree heating weeks.png b/indicator_plots/old plots/Average monthly degree heating weeks.png similarity index 100% rename from indicator_plots/Average monthly degree heating weeks.png rename to indicator_plots/old plots/Average monthly degree heating weeks.png diff --git a/indicator_plots/Commercial fish density.png b/indicator_plots/old plots/Commercial fish density.png similarity index 100% rename from indicator_plots/Commercial fish density.png rename to indicator_plots/old plots/Commercial fish density.png diff --git a/indicator_plots/Coral species richness.png b/indicator_plots/old plots/Coral species richness.png similarity index 100% rename from indicator_plots/Coral species richness.png rename to indicator_plots/old plots/Coral species richness.png diff --git a/indicator_plots/Gross domestic product.png b/indicator_plots/old plots/Gross domestic product.png similarity index 100% rename from indicator_plots/Gross domestic product.png rename to indicator_plots/old plots/Gross domestic product.png diff --git a/indicator_plots/Hotel occupancy rates.png b/indicator_plots/old plots/Hotel occupancy rates.png similarity index 100% rename from indicator_plots/Hotel occupancy rates.png rename to indicator_plots/old plots/Hotel occupancy rates.png diff --git a/indicator_plots/Total pelagic landings.png b/indicator_plots/old plots/Total pelagic landings.png similarity index 100% rename from indicator_plots/Total pelagic landings.png rename to indicator_plots/old plots/Total pelagic landings.png diff --git a/indicator_plots/Total recreational catch.png b/indicator_plots/old plots/Total recreational catch.png similarity index 100% rename from indicator_plots/Total recreational catch.png rename to indicator_plots/old plots/Total recreational catch.png diff --git a/indicator_plots/U.S. Caribbean primary productivity.png b/indicator_plots/old plots/U.S. Caribbean primary productivity.png similarity index 100% rename from indicator_plots/U.S. Caribbean primary productivity.png rename to indicator_plots/old plots/U.S. Caribbean primary productivity.png diff --git a/indicator_plots/U.S. Caribbean sea surface temperature.png b/indicator_plots/old plots/U.S. Caribbean sea surface temperature.png similarity index 100% rename from indicator_plots/U.S. Caribbean sea surface temperature.png rename to indicator_plots/old plots/U.S. Caribbean sea surface temperature.png diff --git a/indicator_plots/outreach_plot.png b/indicator_plots/outreach_plot.png index 42f6e4a..1c1463c 100644 Binary files a/indicator_plots/outreach_plot.png and b/indicator_plots/outreach_plot.png differ diff --git a/indicator_plots/pollution_plot.png b/indicator_plots/pollution_plot.png index 4ed4422..d7513b5 100644 Binary files a/indicator_plots/pollution_plot.png and b/indicator_plots/pollution_plot.png differ diff --git a/indicator_plots/population_plot.png b/indicator_plots/population_plot.png index beda878..890304d 100644 Binary files a/indicator_plots/population_plot.png and b/indicator_plots/population_plot.png differ diff --git a/indicator_plots/tier3_plot.png b/indicator_plots/tier3_plot.png index 3ef2c1f..6c536f0 100644 Binary files a/indicator_plots/tier3_plot.png and b/indicator_plots/tier3_plot.png differ diff --git a/indicator_plots/tier3_plot_TAP.png b/indicator_plots/tier3_plot_TAP.png new file mode 100644 index 0000000..f48454a Binary files /dev/null and b/indicator_plots/tier3_plot_TAP.png differ diff --git a/indicator_plots/total_landings_plot.png b/indicator_plots/total_landings_plot.png index 223c2eb..14a4eb2 100644 Binary files a/indicator_plots/total_landings_plot.png and b/indicator_plots/total_landings_plot.png differ diff --git a/indicator_plots/total_rec_catch_plot.png b/indicator_plots/total_rec_catch_plot.png index 117c628..375bff8 100644 Binary files a/indicator_plots/total_rec_catch_plot.png and b/indicator_plots/total_rec_catch_plot.png differ diff --git a/indicator_plots/turbidity_plot.png b/indicator_plots/turbidity_plot.png index d5d5dd4..ca782b8 100644 Binary files a/indicator_plots/turbidity_plot.png and b/indicator_plots/turbidity_plot.png differ diff --git a/indicator_plots/unemployment_plot.png b/indicator_plots/unemployment_plot.png index c99b253..3a27a0a 100644 Binary files a/indicator_plots/unemployment_plot.png and b/indicator_plots/unemployment_plot.png differ diff --git a/indicator_processing/PlotAllIndicators.R b/indicator_processing/PlotAllIndicators.R index f7f3f5d..8b79ef4 100644 --- a/indicator_processing/PlotAllIndicators.R +++ b/indicator_processing/PlotAllIndicators.R @@ -8,9 +8,9 @@ dev.off() library(plotTimeSeries) - +######################################################## # Define a function to plot and save the plot with optimal resolution -plot_and_save <- function(data_path, plot_params, save_path, width_inch = 8, height_inch = 5, dpi = 300) { +plot_and_save <- function(data_path, plot_params, save_path, width_inch = 5, height_inch = 6, dpi = 300) { tryCatch({ # Load the data @@ -26,7 +26,12 @@ plot_and_save <- function(data_path, plot_params, save_path, width_inch = 8, hei plotcolnum = plot_params$plotcolnum, trendAnalysis = plot_params$trendAnalysis, dateformat = plot_params$dateformat, - sublabel = plot_params$sublabel) + sublabel = plot_params$sublabel, + widadj = plot_params$widadj, + hgtadj = plot_params$hgtadj, + anom = plot_params$anom, + yposadj = plot_params$yposadj, + cex.lab = plot_params$cex.lab) # Close the PNG device dev.off() @@ -42,141 +47,146 @@ plot_and_save <- function(data_path, plot_params, save_path, width_inch = 8, hei datasets <- list( # 1. Degree heating weeks list(data_path = "indicator_objects/DegreeHeatingWeeks.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%Y%m", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%Y%m", sublabel = TRUE, widadj = 1, hgtadj = 0.4, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/DegreeHeatingWeeks_plot.png"), # 2. Ocean acidification via aragonite saturation state list(data_path = "indicator_objects/OA.RData", - plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F), + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "stmon", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/OA_plot.png"), # 3. Hurricane activity list(data_path = "indicator_objects/ACEindex.RData", - plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F), + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/ACEindex_plot.png"), # 4. Turbidity list(data_path = "indicator_objects/turbidity.RData", - plot_params = list(coltoplot = 1:3, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.3, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/turbidity_plot.png"), # 5. Sea surface temperature list(data_path = "indicator_objects/Carib_SST.RData", - plot_params = list(coltoplot = 1:3, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = TRUE, widadj = 0.5, hgtadj = 0.3, anom = "stmon", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/Carib_SST_plot.png"), # 6. Marine debris list(data_path = "indicator_objects/marine_debris.RData", - plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = FALSE, dateformat = "%b%Y", sublabel = F), + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = FALSE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/marine_debris_plot.png"), # 7. Identified point source pollution sites list(data_path = "indicator_objects/pollution.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = FALSE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/pollution_plot.png"), # 8. Primary productivity via ocean color list(data_path = "indicator_objects/carib_Chl.RData", - plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = F), + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "stmon", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/carib_Chl_plot.png"), # 10. Number of major earthquakes list(data_path = "indicator_objects/earthquakes.RData", - plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F), + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/earthquakes_plot.png"), # 11. Fishery/market disturbance indicator list(data_path = "indicator_objects/disturbance.RData", - plot_params = list(coltoplot = 1:3, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.5, anom = "none", yposadj = 1.2, cex.lab = 1.5), save_path = "indicator_plots/disturbance_plot.png"), # 12. Sargassum inundation list(data_path = "indicator_objects/Sargassum.RData", - plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F), + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1.2, hgtadj = 0.9, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/Sargassum_plot.png"), # 13. Tourism via hotel occupancy list(data_path = "indicator_objects/hotel_occupancy.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%Y%b", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%Y%b", sublabel = TRUE, widadj = 1, hgtadj = 0.4, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/hotel_occupancy_plot.png"), - # 14. Population change + # 14. cruise passengers + list(data_path = "indicator_objects/cruise.RData", + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.7, anom = "none", yposadj = 1, cex.lab = 1.5), + save_path = "indicator_plots/cruise_plot.png"), + + # 15. Population change list(data_path = "indicator_objects/population.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.5, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/population_plot.png"), - # 15. Fishery independent surveys of economically important species + # 16. Fishery independent surveys of economically important species list(data_path = "indicator_objects/RVC_PR.RData", - plot_params = list(coltoplot = 1:6, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:6, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.5, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/RVC_PR_plot.png"), list(data_path = "indicator_objects/RVC_STSJ.RData", - plot_params = list(coltoplot = 1:6, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:6, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.5, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/RVC_STSJ_plot.png"), list(data_path = "indicator_objects/RVC_STX.RData", - plot_params = list(coltoplot = 1:6, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:6, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.5, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/RVC_STX_plot.png"), - # 16. Fish density / slope of size spectrum + # 17. Fish density / slope of size spectrum list(data_path = "indicator_objects/fish_density.RData", - plot_params = list(coltoplot = 1:3, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/fish_density_plot.png"), # 18. Pelagic:demersal ratio list(data_path = "indicator_objects/PD_ratio.RData", - plot_params = list(coltoplot = 1:3, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.3, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/PD_ratio_plot.png"), # 19. Maximum length and size structure list(data_path = "indicator_objects/PR_Lmax_classes.RData", - plot_params = list(coltoplot = 1:5, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:5, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.3, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/PR_Lmax_classes_plot.png"), list(data_path = "indicator_objects/STT_Lmax_classes.RData", - plot_params = list(coltoplot = 1:5, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:5, plotrownum = 3, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.3, anom = "none", yposadj = 1.2, cex.lab = 1.5), save_path = "indicator_plots/STT_Lmax_classes_plot.png"), # 20. Total landings list(data_path = "indicator_objects/total_landings.RData", - plot_params = list(coltoplot = 1:9, plotrownum = 3, plotcolnum = 3, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:9, plotrownum = 3, plotcolnum = 3, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1.3, hgtadj = 0.3, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/total_landings_plot.png"), # 23. Ocean economy employment and wages list(data_path = "indicator_objects/oceanNAICS.RData", - plot_params = list(coltoplot = 1:8, plotrownum = 4, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:8, plotrownum = 4, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.4, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/oceanNAICS_plot.png"), # 24. GDP list(data_path = "indicator_objects/GDP.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/GDP_plot.png"), # 25. Unemployment rate list(data_path = "indicator_objects/unemployment.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%Y%b", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%Y%b", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/unemployment_plot.png"), # 26. Economic inequality via gini index list(data_path = "indicator_objects/gini.RData", - plot_params = list(coltoplot = 1:3, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1.3, hgtadj = 0.5, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/gini_plot.png"), # 28. Total recreational catch list(data_path = "indicator_objects/total_rec_catch.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/total_rec_catch_plot.png"), # 29. tier 3 list(data_path = "indicator_objects/tier3.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.4, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/tier3_plot.png"), # 30. outreach list(data_path = "indicator_objects/outreach.RData", - plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F), + plot_params = list(coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 0.4, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/outreach_plot.png"), # 31. coral list(data_path = "indicator_objects/coral_spprichness_cover.RData", - plot_params = list(coltoplot = 1:4, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE), + plot_params = list(coltoplot = 1:4, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1, cex.lab = 1.5), save_path = "indicator_plots/coral_spprichness_cover_plot.png") ) @@ -189,3 +199,200 @@ for (dataset in datasets) { error_datasets <- c(error_datasets, dataset$data_path) }) } + + + + +######################################################## +#### Plot single indicators in wide format + +# Define a function to plot and save the plot with optimal resolution +plot_and_save <- function(data_path, plot_params, save_path, width_inch = 10, height_inch = 4, dpi = 300) { + tryCatch({ + + # Load the data + load(data_path) + + # Open a PNG device with specified dimensions and resolution + png(filename = save_path, width = width_inch * dpi, height = height_inch * dpi, res = dpi) + + # Plot the data with the specified parameters + plotIndicatorTimeSeries(ind, + coltoplot = plot_params$coltoplot, + plotrownum = plot_params$plotrownum, + plotcolnum = plot_params$plotcolnum, + trendAnalysis = plot_params$trendAnalysis, + dateformat = plot_params$dateformat, + sublabel = plot_params$sublabel, + widadj = plot_params$widadj, + hgtadj = plot_params$hgtadj, + anom = plot_params$anom, + yposadj = plot_params$yposadj, + cex.lab = plot_params$cex.lab) + + # Close the PNG device + dev.off() + }, error = function(e) { + message <- paste("Error with dataset:", data_path, "\n", e) + writeLines(message, con = "error_log.txt") + cat(message, "\n") + }) +} + + +# Define the datasets and their specific plot parameters +datasets <- list( + # 2. Ocean acidification via aragonite saturation state + list(data_path = "indicator_objects/OA.RData", + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "stmon", yposadj = 1, cex.lab = 1), + save_path = "indicator_plots/OA_plot_wide.png"), + + # 3. Hurricane activity + list(data_path = "indicator_objects/ACEindex.RData", + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "none", yposadj = 1, cex.lab = 1), + save_path = "indicator_plots/ACEindex_plot_wide.png"), + + # 6. Marine debris + list(data_path = "indicator_objects/marine_debris.RData", + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = FALSE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "none", yposadj = 1, cex.lab = 1), + save_path = "indicator_plots/marine_debris_plot_wide.png"), + + # 8. Primary productivity via ocean color + list(data_path = "indicator_objects/carib_Chl.RData", + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "stmon", yposadj = 1, cex.lab = 1), + save_path = "indicator_plots/carib_Chl_plot_wide.png"), + + # 10. Number of major earthquakes + list(data_path = "indicator_objects/earthquakes.RData", + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1, hgtadj = 1, anom = "none", yposadj = 1, cex.lab = 1), + save_path = "indicator_plots/earthquakes_plot_wide.png"), + + # 12. Sargassum inundation + list(data_path = "indicator_objects/Sargassum.RData", + plot_params = list(coltoplot = 1, plotrownum = 1, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = F, widadj = 1.2, hgtadj = 0.9, anom = "none", yposadj = 1, cex.lab = 1), + save_path = "indicator_plots/Sargassum_plot_wide.png") +) + + +# Loop through each dataset and create plots +for (dataset in datasets) { + tryCatch({ + plot_and_save(dataset$data_path, dataset$plot_params, dataset$save_path) + }, error = function(e) { + error_datasets <- c(error_datasets, dataset$data_path) + }) +} + + + + + +################################################################################ +#### Just LMax + +# Define a function to plot and save the plot with optimal resolution +plot_and_save <- function(data_path, plot_params, save_path, width_inch = 6, height_inch = 8, dpi = 300) { + tryCatch({ + + # Load the data + load(data_path) + + # Open a PNG device with specified dimensions and resolution + png(filename = save_path, width = width_inch * dpi, height = height_inch * dpi, res = dpi) + + # Plot the data with the specified parameters + plotIndicatorTimeSeries(ind, + coltoplot = plot_params$coltoplot, + plotrownum = plot_params$plotrownum, + plotcolnum = plot_params$plotcolnum, + trendAnalysis = plot_params$trendAnalysis, + dateformat = plot_params$dateformat, + sublabel = plot_params$sublabel, + widadj = plot_params$widadj, + hgtadj = plot_params$hgtadj, + anom = plot_params$anom, + yposadj = plot_params$yposadj) + + # Close the PNG device + dev.off() + }, error = function(e) { + message <- paste("Error with dataset:", data_path, "\n", e) + writeLines(message, con = "error_log.txt") + cat(message, "\n") + }) +} + + +# Define the datasets and their specific plot parameters +datasets <- list( + # 19. Maximum length and size structure + list(data_path = "indicator_objects/PR_Lmax_classes.RData", + plot_params = list(coltoplot = 1:5, plotrownum = 5, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.3, anom = "none", yposadj = 1), + save_path = "indicator_plots/PR_Lmax_classes_plot_wide.png"), + list(data_path = "indicator_objects/STT_Lmax_classes.RData", + plot_params = list(coltoplot = 1:5, plotrownum = 5, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.3, anom = "none", yposadj = 1.2), + save_path = "indicator_plots/STT_Lmax_classes_plot_wide.png") +) + + +# Loop through each dataset and create plots +for (dataset in datasets) { + tryCatch({ + plot_and_save(dataset$data_path, dataset$plot_params, dataset$save_path) + }, error = function(e) { + error_datasets <- c(error_datasets, dataset$data_path) + }) +} + + + + + + + +##################################################################################### + +# some extra plot configurations + +png(filename = "indicator_plots/avgLmax_plot_TAP.png", width = 5, height = 6, units = "in", res = 300) +load("indicator_objects/avgLmax.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.7, anom = "none", yposadj = 1, sameYscale = TRUE, cex.axis = 1.3, cex.lab = 1.6, cex.main = 1.6) +dev.off() + + +png(filename = "indicator_plots/cruise_plot_TAP.png", width = 7, height = 5, units = "in", res = 300) +load("indicator_objects/cruise.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.6, anom = "none", yposadj = 1.2, sameYscale = TRUE, cex.axis = 1.3, cex.lab = 1.5, cex.main = 1.6) +dev.off() + +png(filename = "indicator_plots/Carib_SST_plot_TAP.png", width = 6, height = 8, units = "in", res = 300) +load("indicator_objects/Carib_SST.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%m-%Y", sublabel = TRUE, widadj = 0.5, hgtadj = 0.3, anom = "stmon", yposadj = 1, cex.axis = 1.2, cex.lab = 1.5, cex.main = 1.6) +dev.off() + + +png(filename = "indicator_plots/disturbance_plot_TAP.png", width = 6, height = 8, units = "in", res = 300) +load("indicator_objects/disturbance.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 0.7, hgtadj = 0.5, anom = "none", yposadj = 1.2, cex.axis = 1.2, cex.lab = 1.5, cex.main = 1.6) +dev.off() + + + +png(filename = "indicator_plots/fish_density_plot_TAP.png", width = 7, height = 8, units = "in", res = 300) +load("indicator_objects/fish_density.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 0.7, hgtadj = 0.5, anom = "none", yposadj = 1, cex.axis = 1.2, cex.lab = 1.5, cex.main = 1.6) +dev.off() + + + +png(filename = "indicator_plots/gini_plot_TAP.png", width = 7, height = 8, units = "in", res = 300) +load("indicator_objects/gini.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.5, anom = "none", yposadj = 1.2, cex.axis = 1.2, cex.lab = 1.5, cex.main = 1.6, sameYscale = TRUE) +dev.off() + + +png(filename = "indicator_plots/tier3_plot_TAP.png", width = 8, height = 7, units = "in", res = 300) +load("indicator_objects/tier3.RData") +plotIndicatorTimeSeries(ind, coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.4, anom = "none", yposadj = 1.2, sameYscale = F, cex.axis = 1.3, cex.lab = 1.5, cex.main = 1.5) +dev.off() + diff --git a/indicator_processing/automated_download/cruise_visitors.R b/indicator_processing/automated_download/cruise_visitors.R index 36f2ae4..5be4ef5 100644 --- a/indicator_processing/automated_download/cruise_visitors.R +++ b/indicator_processing/automated_download/cruise_visitors.R @@ -112,7 +112,7 @@ class(inddata) <- "indicatordata" # plot and save ---------------------------------- ind <- inddata -plotIndicatorTimeSeries(ind, coltoplot = 1:2, plotrownum = 2, sublabel = TRUE) +plotIndicatorTimeSeries(ind, coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.7, anom = "none", yposadj = 1) save(ind, file = "indicator_objects/cruise.RData") diff --git a/indicator_processing/automated_download/kd490.R b/indicator_processing/automated_download/kd490.R index cce46b2..800c3e0 100644 --- a/indicator_processing/automated_download/kd490.R +++ b/indicator_processing/automated_download/kd490.R @@ -80,7 +80,7 @@ for (yr in styear:enyear) { datdata <- paste(sprintf('%02d',pr_dat$mon),pr_dat$year,sep='-') inddata <- data.frame(cbind(pr_dat$mean, st_dat$mean, sc_dat$mean), row.names = datdata) -labs <- c(rep("Turbidity from ocean color data", 3), rep("Diffuse attenuation coefficient at 490 nm (m^-1)", 3), +labs <- c(rep("Turbidity from ocean color data", 3), rep("Diffuse attenuation coefficient\n at 490 nm (m^-1)", 3), "Puerto Rico", "St. Thomas", "St. Croix") indnames <- data.frame(matrix(labs, nrow = 3, byrow = T)) @@ -91,6 +91,6 @@ class(ind) <- "indicatordata" save(ind, file = "indicator_objects/turbidity.RData") -plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, dateformat = "%m-%Y", sublabel = T, trendAnalysis = F, widadj = 1.5) +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, dateformat = "%m-%Y", sublabel = T, trendAnalysis = F, widadj = 1.5, yposadj = 1.3) plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, dateformat = "%m-%Y", sublabel = T, trendAnalysis = F, widadj = 1.5, anom = "mon") diff --git a/indicator_processing/non_automated/RVC.R b/indicator_processing/non_automated/RVC.R index 9fd5cb1..1953488 100644 --- a/indicator_processing/non_automated/RVC.R +++ b/indicator_processing/non_automated/RVC.R @@ -101,7 +101,7 @@ stx = readRDS("indicator_data/RVC/combined_stx_2001_2023.rds") spcs = c("OCY CHRY", "LUT ANAL", "BAL VETU", "EPI GUTT", "SPA AURO", "SPA VIRI") - +#test = getDomainDensity(prico, species = "OCY CHRY") # Extract the time series for each species and each area @@ -134,11 +134,13 @@ for(j in regions) { datdata <- species_data$YEAR inddata <- data.frame(species_data$density) - s <- cbind(datdata, inddata) + vardata <- data.frame(species_data$var) + s1 <- cbind(datdata, inddata) + s2 <- cbind(s1, vardata) # save ----------------------------------------- - save(s, file = paste("indicator_data/RVC/RUVdensity_", j, "_", i, ".RData", sep = "")) + save(s2, file = paste("indicator_data/RVC/RUVdensity_", j, "_", i, ".RData", sep = "")) } } diff --git a/indicator_processing/non_automated/avgLmax.R b/indicator_processing/non_automated/avgLmax.R new file mode 100644 index 0000000..bb06d78 --- /dev/null +++ b/indicator_processing/non_automated/avgLmax.R @@ -0,0 +1,59 @@ +## Average Lmax per year by island + +rm(list = ls()) +dev.off() + +library(plotTimeSeries) +library(dplyr) + +load("indicator_data/fish-dep-indicators/Lmax_PR.RData") +PR_dat = as.data.frame(findat) + +load("indicator_data/fish-dep-indicators/Lmax_STT.RData") +STT_dat = as.data.frame(findat) + +load("indicator_data/fish-dep-indicators/Lmax_STX.RData") +STX_dat = as.data.frame(findat) + + +styear = min(PR_dat$V1, STT_dat$yrs, STX_dat$yrs) +enyear = max(PR_dat$V1, STT_dat$yrs, STX_dat$yrs) + + +yrs = styear:enyear +PR = PR_dat$lmax + +STT_dat2 = data.frame(yrs = yrs) +STT_dat2 = STT_dat2 %>% + left_join(STT_dat, by = "yrs") + +STT = STT_dat2$lmax + + +STX_dat2 = data.frame(yrs = yrs) +STX_dat2 = STX_dat2 %>% + left_join(STX_dat, by = "yrs") + +STX = STX_dat2$lmax + + + + +# save as indicator object ---------------------- +datdata <- yrs +inddata <- data.frame(cbind(PR, STT, STX)) +labs <- c("Average Lmax" , "length (cm)", "Puerto Rico", + "Average Lmax" , "length (cm)", "St. Thomas and St. John", + "Average Lmax" , "length (cm)", "St. Croix") +indnames <- data.frame(matrix(labs, nrow = 3, byrow = F)) +inddata <- list(labels = indnames, indicators = inddata, datelist = datdata) +class(inddata) <- "indicatordata" + +# plot and save ---------------------------------- + +ind <- inddata +plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 3, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.7, anom = "none", yposadj = 1, sameYscale = TRUE) + +save(ind, file = "indicator_objects/avgLmax.RData") + +############################### END ############################# \ No newline at end of file diff --git a/indicator_processing/non_automated/tier_designation.R b/indicator_processing/non_automated/tier_designation.R index eb60494..d6572b6 100644 --- a/indicator_processing/non_automated/tier_designation.R +++ b/indicator_processing/non_automated/tier_designation.R @@ -23,8 +23,8 @@ USVI = c(0,0,0,0,0,0,0,0,0,0,0,0,USVI_perc) # save as indicator object ---------------------- datdata <- 2011:2023 inddata <- data.frame(cbind(PR, USVI)) -labs <- c("Stocks/complexes with Tier 3 designation" , "Percent", "Puerto Rico", - "Stocks/complexes with Tier 3 designation" , "Percent", "USVI") +labs <- c("Stocks/complexes with ACLs derived from stock assessments" , "Percent", "Puerto Rico", + "Stocks/complexes with ACLs derived from stock assessments" , "Percent", "USVI") indnames <- data.frame(matrix(labs, nrow = 3, byrow = F)) inddata <- list(labels = indnames, indicators = inddata, datelist = datdata) class(inddata) <- "indicatordata" diff --git a/test.pptx b/test.pptx new file mode 100644 index 0000000..03036e8 Binary files /dev/null and b/test.pptx differ diff --git a/test.qmd b/test.qmd new file mode 100644 index 0000000..5a7b3e5 --- /dev/null +++ b/test.qmd @@ -0,0 +1,10 @@ +--- +title: "Presentation" +format: + pptx: + reference-doc: PPT.pptx +--- + +# test + +## hi \ No newline at end of file