Skip to content

Commit

Permalink
create a new plot all indicators script
Browse files Browse the repository at this point in the history
  • Loading branch information
CarissaGervasi-NOAA committed Jun 12, 2024
1 parent a32de68 commit 7e4eebb
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
class(inddata) <- "indicatordata"
save(inddata, file = "indicator_objects/RVC_STX.RData")
load("../indicator_objects/RVC_PR.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:6, trendAnalysis = T, sublabel = T)
# 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",
Expand Down Expand Up @@ -510,3 +505,8 @@ load("../indicator_objects/unemployment.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:2, trendAnalysis = T, sublabel = T, dateformat = "%Y%b")
load("../indicator_objects/coral_spprichness_cover.RData")
plotIndicatorTimeSeries(ind, coltoplot = 1:4, sublabel = T, trendAnalysis = T)
# load libraries ---------------------------------
rm(list = ls())
library(plotTimeSeries)
directory <- rprojroot::find_rstudio_root_file()
plot(1)
Binary file not shown.
87 changes: 87 additions & 0 deletions indicator_processing/PlotAllIndicators.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#
# script to plot ALL indicators for report
# C. Gervasi Jun 6 2024

# load libraries ---------------------------------
rm(list = ls())

library(plotTimeSeries)

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

directory <- rprojroot::find_rstudio_root_file()

# source all .RData files in indicator_objects folder --------------

# run all scripts in folder ---------------------

setwd(directory)
dir("indicator_objects")

# fully automated - pull from internet ----------

#source("sst.RData") # sea surface temperature
source("ACEindex.RData") # hurricane energy index
source("carib_Chl.RData") # primary productivity
source("DegreeHeatingWeeks.RData") # degree heating weeks
source("earthquakes.RData") # earthquakes
#source("kd490.R") # turbidity from Kd490 # THIS DOWNLOAD CAN BE FINICKY
source("unemployment.RData") # unemployment rate
source("GDP.RData") # Gross Domestic Product

# partially automated - pull from data in folder ----------------------

source("marine_debris.RData") # marine debris
source("OA.RData") # ocean acidification
source("indicator_processing/non_automated/CRMP_compile.R") # fishery-indepenedent fish density, slope of size spectrum, coral cover indicators
source("indicator_processing/non_automated/Sargassum_inundation.R") # sargassum indicator
source("indicator_processing/non_automated/SAU_recreational_catch.R") # recreational catch based on Sea Around Us database
source("indicator_processing/non_automated/pollution.R") # reported superfund sites etc.

# fishery indicators - includes confidential data ----------------------

confpath <- "C:/Users/mandy.karnauskas/Desktop/CONFIDENTIAL/CaribbeanData/"

dir("indicator_processing/fishery_dependent/")

source("indicator_processing/fishery_dependent/INDICATOR_total_landings.R") # calc total landings by group
source("indicator_processing/fishery_dependent/INDICATOR_gearchanges.R") # produces plots but no indicator objects
source("indicator_processing/fishery_dependent/INDICATOR_gini.R") # calculate gini index based on revenues
# not done below

#
source("indicator_processing/fishery_dependent/INDICATOR_disturbance.R") #
source("indicator_processing/fishery_dependent/INDICATOR_fishery_indicators_PR.R") #
source("indicator_processing/fishery_dependent/INDICATOR_fishery_indicators_STT.R") #
source("indicator_processing/fishery_dependent/INDICATOR_fishery_indicators_STX.R") #





###############################################################

# Notes for standardizing scripts:

# Top:

# specification file and libraries -----------------------------
rm(list = ls())
dev.off()

library(maps)
library(plotTimeSeries)

load("../spec_file.RData")

# define years --------------------------------
styear <- 1961
enyear <- terminal_year


# Bottom:
# save all indicators as "ind" object

save(ind, file = "../../indicator_objects/INDICATOR_NAME.RData")

##

0 comments on commit 7e4eebb

Please sign in to comment.