library(r4ss)
library(dplyr)
library(stringr)
library(magrittr)
library(ggplot2)
<- this.path::this.proj()
main_dir
<- SS_output(dir = file.path(main_dir, "stock-synthesis-models", params$model1_dir), verbose=FALSE, printstats=FALSE)
report1 <- report1$parameters %>%
new_steep1 filter(str_detect(Label, "SR_BH_steep")) %>% ## Need to change this to match the parameter name in control file
pull(Value)
<- SS_output(dir = file.path(main_dir, "stock-synthesis-models", params$model2_dir), verbose=FALSE, printstats=FALSE)
report2 <- report2$parameters %>%
new_steep2 filter(str_detect(Label, "SR_BH_steep")) %>% ## Need to change this to match the parameter name in control file
pull(Value)
Report template
Model modifications description
I changed the steepness to 0.5 and 0.7.
Plot of SSB for Steepness = 0.5
Here is a plot showing the timeseries of SSB for the modified model with steepness=0.5.
Code
<- report1$timeseries %>%
ssb_summary select(Yr, SpawnBio) %>%
mutate(model_name = params$model1_dir)
%>%
ssb_summary ggplot() +
geom_line(aes(x = Yr, y = SpawnBio)) +
xlab("Year") +
ylab("Spawning Biomass") +
theme(panel.background = element_rect(fill = "white", color = "black", linetype = "solid"),
panel.grid.major = element_line(color = 'gray70',linetype = "dotted"),
panel.grid.minor = element_line(color = 'gray70',linetype = "dotted"),
strip.background =element_rect(fill="white"),
legend.key = element_rect(fill = "white"))
Plot of SSB for Steepness = 0.7
Here is a plot showing the timeseries of SSB for the modified model with steepness=0.7.
Code
<- report2$timeseries %>%
ssb_summary select(Yr, SpawnBio) %>%
mutate(model_name = params$model2_dir)
%>%
ssb_summary ggplot() +
geom_line(aes(x = Yr, y = SpawnBio)) +
xlab("Year") +
ylab("Spawning Biomass") +
theme(panel.background = element_rect(fill = "white", color = "black", linetype = "solid"),
panel.grid.major = element_line(color = 'gray70',linetype = "dotted"),
panel.grid.minor = element_line(color = 'gray70',linetype = "dotted"),
strip.background =element_rect(fill="white"),
legend.key = element_rect(fill = "white"))