Skip to content

Commit

Permalink
moving plot all indicators file
Browse files Browse the repository at this point in the history
  • Loading branch information
CarissaGervasi-NOAA committed Jun 13, 2024
1 parent 6ddc73b commit 585fc75
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 121 deletions.
68 changes: 34 additions & 34 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
datdata <- 2001:2021
inddata <- data.frame(cbind(RUVdensity_PRICO_BAL_VETU$species_data.density, RUVdensity_PRICO_EPI_GUTT$species_data.density, RUVdensity_PRICO_LUT_ANAL$species_data.density, RUVdensity_PRICO_OCY_CHRY$species_data.density, RUVdensity_PRICO_SPA_AURO$species_data.density, RUVdensity_PRICO_SPA_VIRI$species_data.density))
labs <- c("PR" , "Density", "queen triggerfish",
"PR" , "Density", "red hind",
"PR" , "Density", "mutton snapper",
"PR" , "Density", "yellowtail snapper",
"PR" , "Density", "redband parrotfish",
"PR" , "Density", "stoplight parrotfish")
indnames <- data.frame(matrix(labs, nrow = 6, byrow = F))
inddata <- list(labels = indnames, indicators = inddata, datelist = datdata)
class(inddata) <- "indicatordata"
save(inddata, file = "indicator_objects/RVC_PR.RData")
View(RUVdensity_PRICO_SPA_VIRI)
View(RUVdensity_PRICO_SPA_VIRI)
load("../indicator_objects/RVC_PR.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:6, trendAnalysis = T, sublabel = T)
load("../indicator_objects/landings.RData")
load("../indicator_objects/RVC_PR.RData")
load("../indicator_objects/landings.RData")
load("../indicator_objects/fish_density.RData")
# Puerto Rico
datdata <- 2001:2021
inddata <- data.frame(cbind(RUVdensity_PRICO_BAL_VETU$species_data.density, RUVdensity_PRICO_EPI_GUTT$species_data.density, RUVdensity_PRICO_LUT_ANAL$species_data.density, RUVdensity_PRICO_OCY_CHRY$species_data.density, RUVdensity_PRICO_SPA_AURO$species_data.density, RUVdensity_PRICO_SPA_VIRI$species_data.density))
labs <- c("PR" , "Density", "queen triggerfish",
"PR" , "Density", "red hind",
"PR" , "Density", "mutton snapper",
"PR" , "Density", "yellowtail snapper",
"PR" , "Density", "redband parrotfish",
"PR" , "Density", "stoplight parrotfish")
indnames <- data.frame(matrix(labs, nrow = 3, byrow = F))
inddata <- list(labels = indnames, indicators = inddata, datelist = datdata)
class(inddata) <- "indicatordata"
save(inddata, file = "indicator_objects/RVC_PR.RData")
# St. Thomas & St. John
datdata <- 2001:2021
inddata <- data.frame(cbind(RUVdensity_STTSTJ_BAL_VETU$species_data.density, RUVdensity_STTSTJ_EPI_GUTT$species_data.density, RUVdensity_STTSTJ_LUT_ANAL$species_data.density, RUVdensity_STTSTJ_OCY_CHRY$species_data.density, RUVdensity_STTSTJ_SPA_AURO$species_data.density, RUVdensity_STTSTJ_SPA_VIRI$species_data.density))
labs <- c("STTSTJ" , "Density", "queen triggerfish",
"STTSTJ" , "Density", "red hind",
Expand Down Expand Up @@ -510,3 +476,37 @@ rm(list = ls())
library(plotTimeSeries)
directory <- rprojroot::find_rstudio_root_file()
plot(1)
rm(list = ls())
directory <- rprojroot::find_rstudio_root_file()
setwd(directory)
dir("indicator_objects")
library(plotTimeSeries)
library(spam)
load("DegreeHeatingWeeks.RData")
# load libraries ---------------------------------
rm(list = ls())
library(plotTimeSeries)
directory <- rprojroot::find_rstudio_root_file()
setwd(directory)
dir("indicator_objects")
load("DegreeHeatingWeeks.RData")
setwd(directory)
dir("indicator_objects")
load("indicator_objects/DegreeHeatingWeeks.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = T, sublabel = T, dateformat = "%Y%m", plotrownum = 2, plotcolnum = 1)
rm(list = ls())
directory <- rprojroot::find_rstudio_root_file()
setwd(directory)
library(plotTimeSeries)
library(spam)
load("indicator_objects/DegreeHeatingWeeks.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = T, sublabel = T, dateformat = "%Y%m", plotrownum = 2, plotcolnum = 1)
load("../indicator_objects/OA.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)
load("../indicator_objects/ACEindex.RData")
load("indicator_objects/OA.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)
load("indicator_objects/ACEindex.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)
load("indicator_objects/Sargassum.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)
189 changes: 189 additions & 0 deletions indicator_objects/PlotAllIndicators.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
#
# script to plot ALL indicators for report - DRAFT, STILL WORKING ON
# C. Gervasi Jun 6 2024

rm(list = ls())

# find root directory for project ---------------

directory <- rprojroot::find_rstudio_root_file()
setwd(directory)


library(plotTimeSeries)
library(spam)

### 1. Degree heating weeks

load("indicator_objects/DegreeHeatingWeeks.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = T, sublabel = T, dateformat = "%Y%m", plotrownum = 2, plotcolnum = 1)

### 2. Ocean acidification via aragonite saturation state

load("indicator_objects/OA.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)

### 3. Hurricane activity

load("indicator_objects/ACEindex.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)

### 4. Turbidity

load("indicator_objects/turbidity.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 2, trendAnalysis = T, dateformat = "%m-%Y", sublabel = T)

### 5. Sea surface temperature

load("indicator_objects/Carib_SST.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:3, trendAnalysis = T, sublabel = T, dateformat = "%m-%Y")

### 6. Marine debris

load("indicator_objects/marine_debris.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = F)

### 7. Identified point source pollution sites

load("indicator_objects/pollution.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = F, sublabel = T)

### 8. Primary productivity via ocean color

load("indicator_objects/carib_Chl.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T, dateformat = "%m-%Y")

### 9. Coastal development via land cover

# Just a figure

### 10. Number of major earthquakes

load("indicator_objects/earthquakes.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)

### 11. Fishery/market disturbance indicator

load("indicator_objects/disturbance.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:3, trendAnalysis = T, sublabel = T)

### 12. Sargassum inundation

load("indicator_objects/Sargassum.RData")
plotIndicatorTimeSeries(ind, trendAnalysis = T)

### 13. Tourism via hotel occupancy

load("indicator_objects/hotel_occupancy_rates_USVI_and_PR.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:2, sublabel = T, trendAnalysis = T, dateformat = "%Y%b")

load("indicator_objects/hotel_occupancy.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:2, sublabel = T, trendAnalysis = T,dateformat = "%Y%b")
### 14. Population change

#14 - MAPS but also should be census data

### 15. Fishery independent surveys of economically important species

load("../indicator_objects/RVC_PR.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:6, trendAnalysis = T, sublabel = T)

load("../indicator_objects/RVC_STSJ.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:6, trendAnalysis = T, sublabel = T)

load("../indicator_objects/RVC_STX.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:6, trendAnalysis = T, sublabel = T)

#Indicator 16.1 - abundance of commercial fish based on TCRMP and PRCRMP

#Indicator 16.2 - slope of the size spectrum based on TCRMP and PRCRMP

### 17. Commercial landings

load("../indicator_objects/landings.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:6, trendAnalysis = T, sublabel = T)

load("../indicator_objects/fish_density.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:3, plotrownum = 2, trendAnalysis = T, sublabel = T)

### 18. Pelagic:demersal ratio

#Indicator 18

### 19 Maximum length and size structure

#Indicator 19 - Lmax indicator

### 20. Changes in target species / landing composition

load("../indicator_objects/total_landings.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:9, plotrownum = 3, plotcolnum = 3, trendAnalysis = T, sublabel = T)

### 21. Total, lobster and conch revenues

# Just figures

### 22. Total, lobster and conch trips

# Indicator 22 - number of trips

### 23. Ocean economy employment and wages

load("../indicator_objects/OceanNAICS.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:8, plotrownum = 2, trendAnalysis = T, sublabel = T)

### 24. GDP

load("../indicator_objects/GDP.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = T, sublabel = T)

### 25. Unemployment

load("../indicator_objects/unemployment.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = T, sublabel = T, dateformat = "%Y%b")

### 26. Gini coefficient for distribution of landings and revenue

load("../indicator_objects/gini.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:3, plotrownum = 2, trendAnalysis = T, sublabel = T)

### 27. Commercial fishing community engagement and reliance

# Indicator 27 - working with Tarsila on

### 28. Recreational fishing engagement and participation

load("../indicator_objects/total_rec_catch.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:2, trendAnalysis = T, sublabel = T)

### 29. Commercial fishing engagement and participation

# Indicator 29

### 30. Changes in gear type

# Just plots

### 31. Number of seasonal closures implemented

#Indicator 31

### 32. Number of education and outreach events

#Indicator 32

### 33. Number of enforcement actions

#Indicator 33

### 34 Percent coral cover

load("../indicator_objects/NCRMP_coral_cover_richness.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:6, sublabel = T, trendAnalysis = F)

### 35. Coral species diversity

load("../indicator_objects/coral_spprichness_cover.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:4, sublabel = T, trendAnalysis = T)


4 changes: 4 additions & 0 deletions indicator_processing/CalculateAllIndicators.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ enyear <- terminal_year
save(ind, file = "indicator_objects/INDICATOR_NAME.RData")

##




87 changes: 0 additions & 87 deletions indicator_processing/PlotAllIndicators.R

This file was deleted.

0 comments on commit 585fc75

Please sign in to comment.