setwd("~/Desktop/gitTest/erp_mac/rmd")

Feasibility review

This is an R Markdown document for the visualization of feasibility scores for the development of ICES forage fish stock Ecological reference points (ERPs) using EwE models.

Scoring is based on the following:

Model area (0-2): 0= no model of the stock area; 1= models that cover part or the entire area but no single model covering the stocks distribution; 2= model available covering the entire stock distribution.

Stock functional group (0-2): 0= stock not included as a single species functional group; 1= stock included as a single species group in models covering parts of the stock distribution; 2= stock included as a single species group in a model covering the full stock distribution.

ICES key-run (0-2): 0= no model with an ICES key-run for the stock area; 1= key-run models available for parts of the stocks distribution; 2= ICES key-run available for area covering entire stock distribution.

# Reshape the data to long format
data <- pivot_longer(ERP_F, cols = c(Area_S, FG_S, Keyrun_S), names_to = "Column", values_to = "Value")

# Create a stacked bar plot with descending order, rotated x-axis labels, colors from Viridis, and modified theme
ERP_plot<-ggplot(data, aes(x = reorder(Stock, -Value), y = Value, fill = Column)) +
  geom_bar(stat = "identity", position = "stack") +
  labs(x = "Forage fish stock", y = "Feasibility score") +
  scale_fill_manual(values = viridis(3), labels = c("Model area (0-2)", "Stock functional group (0-2)", "ICES key-run (0-2)"), name = "Score categories") +
  theme_minimal() +
  theme(
   plot.background = element_rect(fill = "white"),
    axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
    panel.border = element_rect(color = "black", fill = NA),
    axis.line.y = element_line(color = "black"),
    axis.ticks.y = element_line(color = "black"),
    axis.text.y = element_text(margin = margin(r = 5)),
    panel.grid.major.y = element_line(color = "gray", linetype = "dashed"),
    panel.grid.minor.y = element_blank(),
    plot.margin = margin(10, 10, 10, 10),
    legend.position = "top"
  ) +
  scale_y_continuous(breaks = seq(0, 7, by = 1))

ggsave("../outputs/figs/ERP_plot.png", ERP_plot, dpi = 500)
## Saving 7 x 5 in image
ERP_plot
Figure 1. Feasibility scores for the development of forage fish Ecological Reference Points (ERPs) using Ecopath with Ecosim (EwE). ERP feasibility using EwE was evaluated based on (1) the extent of available models relative to stock distribution, (2) whether the stock is included in the model as a single species group, and (3) whether the available models have an ICES key-run.

Figure 1. Feasibility scores for the development of forage fish Ecological Reference Points (ERPs) using Ecopath with Ecosim (EwE). ERP feasibility using EwE was evaluated based on (1) the extent of available models relative to stock distribution, (2) whether the stock is included in the model as a single species group, and (3) whether the available models have an ICES key-run.