-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from MOshima-PIFSC/JAY
Adding group report
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
title: "Report template" | ||
author: Yi-Jay Chang and Riyar Chiang | ||
format: | ||
html: | ||
embed-resources: true | ||
params: | ||
parameter: "steepness" | ||
model_dir: "steepness-0.7" | ||
--- | ||
|
||
```{r} | ||
#| code-fold: true | ||
#| message: false | ||
library(r4ss) | ||
library(dplyr) | ||
library(stringr) | ||
library(magrittr) | ||
library(ggplot2) | ||
main_dir <- this.path::this.proj() | ||
report <- SS_output(dir = file.path(main_dir, "stock-synthesis-models", params$model_dir), verbose=FALSE, printstats=FALSE) | ||
new_steep <- report$parameters %>% | ||
filter(str_detect(Label, "SR_BH_steep")) %>% ## Need to change this to match the parameter name in control file | ||
pull(Value) | ||
``` | ||
|
||
# Model modification description | ||
I changed the `r params$parameter` to `r new_steep`. | ||
|
||
# Plot of SSB | ||
In fisheries science, SSB stands for Spawning Stock Biomass, which is a critical measure in stock assessment. SSB represents the total weight of all mature fish in a population capable of reproducing. It is an essential metric used to evaluate the health and sustainability of a fishery stock. By tracking SSB over time, scientists can assess the stock's reproductive potential and determine if management measures are needed to ensure its long-term viability. | ||
|
||
```{r} | ||
#| code-fold: true | ||
ssb_summary <- report$timeseries %>% | ||
select(Yr, SpawnBio) %>% | ||
mutate(model_name = params$model_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 recruitment | ||
Recruitment in stock assessment refers to the process by which young fish (juveniles) enter the population and become part of the fishery. Typically, recruitment is measured as the number of fish that reach a specific life stage, such as the size or age at which they are first caught by fishing gear or become part of the spawning population. | ||
|
||
```{r} | ||
#| code-fold: true | ||
Recruit_summary <- report$recruit %>% | ||
select(Yr, dev) %>% | ||
mutate(model_name = params$model_dir) | ||
Recruit_summary %>% | ||
ggplot() + | ||
geom_line(aes(x = Yr, y = dev)) + | ||
xlab("Year") + | ||
ylab("dev") + | ||
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")) | ||
``` | ||
|