Skip to content

Commit

Permalink
Merge pull request #10 from MOshima-PIFSC/JAY
Browse files Browse the repository at this point in the history
Adding group report
  • Loading branch information
yijay authored Jan 16, 2025
2 parents 9dfe6fa + 676e522 commit 9b6782e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ website:
contents:
- text: "Report template"
file: assets/day-3-report-template.qmd
- text: "Yi-Jay & Riyar's SS reprot"
file: assets/test_doc.qmd
- text: "Report Claudio"
file: assets/day-3-report-template_CCJ.qmd
- text: "kai Report template"
Expand Down
75 changes: 75 additions & 0 deletions assets/test_doc.qmd
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"))
```

0 comments on commit 9b6782e

Please sign in to comment.