-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfisheryReport.rmd
508 lines (452 loc) · 20.1 KB
/
fisheryReport.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
---
title: "Fishery Advice - Celtic Seas"
author: "Prepared by: Scott I. Large"
date: "31 March 2016"
output: html_document
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(fig.width = 6.5, fig.height = 4.5, fig.path = '')
# devtools::install_github("ICES-dk/rICES", force = FALSE)
# devtools::install_github("hadley/readxl", force = FALSE)
library(rICES)
library(readxl)
library(dplyr)
library(RColorBrewer)
library(knitr)
library(XML)
library(stringr)
library(reshape2)
library(ggplot2)
#
plotDir = "output/"
options(scipen = 5)
#
```
```{r getDat, include = FALSE, cache = TRUE}
catchURL <- "http://ices.dk/marine-data/Documents/CatchStats/OfficialNominalCatches.zip"
effortURL <- "http://stecf.jrc.ec.europa.eu/documents/43805/870977/2014_STECF+14-20+-+Fishing+Effort+Regimes+data+tables.zip"
spURL <- "ftp://ftp.fao.org/FI/STAT/DATA/ASFIS_sp.zip"
#
tmpFileCatch <- tempfile(fileext = ".zip")
tmpFileEffort <- tempfile(fileext = ".zip")
tmpFileSp <- tempfile(fileext = ".zip")
#
download.file(catchURL, destfile = tmpFileCatch, mode = "wb", quiet = T)
download.file(effortURL, destfile = tmpFileEffort, mode = "wb", quiet = T)
download.file(spURL, destfile = tmpFileSp, mode = "wb", quiet = T)
#
#```
#```{r loadDat, include = FALSE}
catchDat <- read.csv(unz(tmpFileCatch,
"ICESCatchDataset2006-2014.csv"),
stringsAsFactors = F, header = T, fill = TRUE)
#
#
effortDat <- read_excel(unzip(tmpFileEffort,
files = "Electronic_appendices/Effort_trends_by_country.xlsx"),
sheet = "kWdays at sea")
#
stecfCatchDat <- read_excel(unzip(tmpFileEffort,
files = "Electronic_appendices/Landings_Discards_Discard-rates.xlsx"),
sheet = "Land_Disc_Disc-rate_by_Country")
#
spList <- read.table(unz(tmpFileSp,
"ASFIS_sp_Feb_2015.txt"),
header = TRUE,
fill = TRUE,
stringsAsFactors = FALSE)
#
# FAO codes and ICES stock codes
speciesID <- read.csv("~/rCode/Data/ICESspeciesID_v1.csv",
stringsAsFactors = FALSE)
#
# Fishery guilds by ICES stock code
fisheryGuild <- read.csv("~/git/ices-dk/rStockOverview/fisheryGuild.csv",
stringsAsFactors = FALSE)
#
fisheryGuild$speciesID <- toupper(gsub( "-.*$", "", fisheryGuild$Stock.code))
#
fisheryGuild <- fisheryGuild %>%
inner_join(speciesID, c("speciesID" = "oldCode"))
#
ecoAreaCatch <- toupper(c("27.7.a",
"27.7.b",
"27.7.c.2",
"27.7.e",
"27.7.f",
"27.7.g",
"27.7.h",
"27.7.j.2",
"27.7.k.2",
"27.6.a",
"27.6.b.NK",
"27.6.b.2"))
#
# https://datacollection.jrc.ec.europa.eu/c/document_library/get_file?uuid=62841ee4-dbbd-4628-a7a7-5036ce5d415b&groupId=10213
ecoAreaEffort <- c("6 EU", "3C", "7BCEFGHJK") # Looks wrong, but 3c is STEFC for 7a
#
guildList <-
catchDat %>%
Filter(f = function(x)!all(is.na(x))) %>%
filter(Area %in% ecoAreaCatch) %>%
melt(id.vars = c("Species", "Area", "Units", "Country"),
variable.name = "YEAR",
value.name = "VALUE") %>%
mutate(YEAR = as.numeric(gsub("X", "", YEAR))) %>%
group_by(Species) %>%
mutate(totalCatch = sum(VALUE, na.rm = TRUE)) %>%
inner_join(spList, c("Species" = "X3A_CODE")) %>%
full_join(fisheryGuild, c("Species" = "newCode")) %>%
select(Species, totalCatch, Scientific_name, English_name, Family, Fisheries.Guild) %>%
ungroup() %>%
arrange(-totalCatch) %>%
filter(is.na(Fisheries.Guild) &
totalCatch > 0) %>%
distinct(Scientific_name)
#
# write.csv(guildList, file = "~/git/ices-dk/FisheriesAdvice/keys-lists/CS_spGuildList.csv",
# row.names = FALSE)
```
```{r catchDat, include = FALSE}
catchDat <-
catchDat %>%
Filter(f = function(x)!all(is.na(x))) %>%
filter(Area %in% ecoAreaCatch) %>%
melt(id.vars = c("Species", "Area", "Units", "Country"),
variable.name = "YEAR",
value.name = "VALUE") %>%
mutate(YEAR = as.numeric(gsub("X", "", YEAR)))
#
catchCountry <- catchDat %>%
group_by(YEAR, Country) %>%
dplyr::summarize(countryCatch = sum(VALUE)) # %>% # Total annual catch
# Convert country codes to proper names
#
```
```{r figure1, echo = FALSE, include = TRUE, fig.cap= "Figure 1. Landings (tonnes) by nation within the Celtic Seas ecoregion (ICES areas: 6a, 6b.2, 6b.NK, 7a, 7b, 7c.2, 7e, 7f, 7g, 7h, 7j.2, 7k.2), as reported to ICES."}
#
catchPlot <- catchCountry %>%
group_by(Country) %>%
dplyr::summarize(countryTotal = sum(countryCatch)) %>% # Overall catch to order plot
arrange(-countryTotal) %>%
dplyr::mutate(RANK = min_rank(desc(countryTotal))) %>%
inner_join(catchCountry, c("Country" = "Country")) %>%
dplyr::mutate(Country = replace(Country, RANK > 9, "OTHER")) %>%
group_by(YEAR, Country) %>%
dplyr::mutate(countryCatch = sum(countryCatch)) %>%
distinct(YEAR, Country)
#
catchPlot$Country <- factor(catchPlot$Country, levels = rev(unique(catchPlot$Country)))
myColors <- c("grey40", brewer.pal(length(unique(catchPlot$Country)) - 1, "Spectral"))
names(myColors) <- levels(catchPlot$Country)
#
ggplot(catchPlot, aes(x = YEAR, y = countryCatch)) +
geom_area(aes(fill = Country, color = Country), alpha = .8, position = "stack") +
scale_fill_manual(values = myColors) +
scale_color_manual(values = myColors) +
labs(x = "Year",
y = "Landings (tonnes)",
fill = "Country",
color = "Country") +
theme_bw()
# ggsave(filename = paste0(plotDir, "CS_FisheryOverview-figure1.png"), width = 6.5,
# height = 4.5)
#
```
### Figure 1 corrections
* Country names and colors should be consistent between Figure 1 and 2. Need to make a look-up table between STECF and ICES country codes
* Merge UK with Scotland (Northern Ireland, Jersey, etc.)
* Explore pre-2006 up to 1990
** Not exactly straight-forward to add this info
* Spain may be missing? Double check
```{r effortDat, include = FALSE}
effortDat <-
# tt <-
effortDat %>%
Filter(f = function(x)!all(is.na(x))) %>%
filter(reg_area_cod %in% ecoAreaEffort) %>%
melt(id.vars = c("annex", "reg_area_cod", "reg_gear_cod", "Specon_calc", "country", "vessel_length"),
variable.name = "YEAR",
value.name = "VALUE") %>%
mutate(YEAR = as.numeric(levels(YEAR))[YEAR])
#
effortCountry <- effortDat %>%
group_by(YEAR, country) %>%
dplyr::summarize(countryEffort = sum(VALUE, na.rm = T)) # %>% # Total annual catch
# Convert country codes to proper names
```
```{r figure2, echo = FALSE, include = TRUE, fig.cap= "Figure 2. Effort (kW days at sea) by nation within the Celtic Seas ecoregion (6 EU and 7a, 7b, 7c, 7e, 7f, 7g, 7h, 7j, 7k), as reported to STECF."}
effortPlot <- effortCountry %>%
group_by(country) %>%
dplyr::summarize(countryTotal = sum(countryEffort)) %>% # Overall catch to order plot
arrange(-countryTotal) %>%
dplyr::mutate(RANK = min_rank(desc(countryTotal))) %>%
inner_join(effortCountry, c("country" = "country")) %>%
dplyr::mutate(country = replace(country, RANK > 9, "OTHER"))%>%
group_by(YEAR, country) %>%
dplyr::mutate(countryEffort = sum(countryEffort)) %>%
distinct(YEAR, country)
#
effortPlot$country <- factor(effortPlot$country, levels = rev(unique(effortPlot$country)))
myColors <- c("grey40", brewer.pal(length(unique(effortPlot$country)) - 1, "Spectral"))
names(myColors) <- levels(effortPlot$country)
#
ggplot(effortPlot, aes(x = YEAR, y = countryEffort)) +
geom_area(aes(fill = country, color = country), alpha = .8, position = "stack") +
# scale_x_continuous(limits = range(effortPlot$YEAR), breaks = seq(from = min(effortPlot$YEAR),
# to = max(effortPlot$YEAR,
# by = .5))) +
scale_fill_manual(values = myColors) +
scale_color_manual(values = myColors) +
labs(x = "Year",
y = "Effort (kW days at sea)",
fill = "Country",
color = "Country") +
theme_bw()
# ggsave(filename = paste0(plotDir, "CS_FisheryOverview-figure2.png"), width = 6.5,
# height = 4.5)
```
## Figure 2 corrections
* (see figure 1: Country names and colors should be consistent between Figure 1 and 2. Need to make a look-up table between STECF and ICES country codes)
* [STECF Reference Metadata](https://datacollection.jrc.ec.europa.eu/c/document_library/get_file?uuid=62841ee4-dbbd-4628-a7a7-5036ce5d415b&groupId=10213) claims that 3c == ICES subarea 7a. Double check
* Check the effort data years... might be an ordinal/nominal issue
* Explore the RDB... should have access
```{r guildDat, include = FALSE}
guildDat <-
catchDat %>%
inner_join(spList, c("Species" = "X3A_CODE")) %>%
full_join(fisheryGuild, c("Species" = "newCode"))
#
guildCatch <-
guildDat %>%
dplyr::mutate(Fisheries.Guild = ifelse(is.na(Fisheries.Guild), "not defined", Fisheries.Guild)) %>%
group_by(YEAR, Fisheries.Guild) %>%
dplyr::summarize(guildCatch = sum(VALUE, na.rm = TRUE)) %>%
filter(!is.na(YEAR))
#
```
```{r figure3, echo = FALSE, include = TRUE, fig.cap= "Figure 3. Catch (tonnes) by fishery guild within the Celtic Seas ecoregion(6a, 6b.2, 6b.NK, 7a, 7b, 7c.2, 7e, 7f, 7g, 7h, 7j.2, 7k.2)"}
guildPlot <- guildCatch %>%
group_by(Fisheries.Guild) %>%
dplyr::summarize(guildTotal = sum(guildCatch, na.rm = TRUE)) %>% # Overall catch to order plot
arrange(-guildTotal) %>%
dplyr::mutate(RANK = min_rank(desc(guildTotal))) %>%
inner_join(guildCatch, c("Fisheries.Guild" = "Fisheries.Guild")) %>%
dplyr::mutate(Fisheries.Guild = replace(Fisheries.Guild, RANK > 9, "OTHER")) %>%
group_by(YEAR, Fisheries.Guild) %>%
dplyr::mutate(guildCatch = sum(guildCatch)) %>%
distinct(YEAR, Fisheries.Guild)
#
guildPlot$Fisheries.Guild <- factor(guildPlot$Fisheries.Guild, levels = rev(unique(guildPlot$Fisheries.Guild)))
myColors <- c("grey40", brewer.pal(length(unique(guildPlot$Fisheries.Guild)) - 1, "Spectral"))
names(myColors) <- levels(guildPlot$Fisheries.Guild)
#
ggplot(guildPlot, aes(x = YEAR, y = guildCatch)) +
geom_area(aes(fill = Fisheries.Guild, color = Fisheries.Guild), alpha = .8, position = "stack") +
scale_fill_manual(values = myColors) +
scale_color_manual(values = myColors) +
labs(x = "Year",
y = "Nominal Catch (tonnes)",
fill = "Fishery guild",
color = "Fishery guild") +
theme_bw()
# ggsave(filename = paste0(plotDir, "CS_FisheryOverview-figure3.png"), width = 6.5,
# height = 4.5)
```
## Figure 3 corrections
* define "not defined" fishery guilds.
```{r speciesCatch, include = FALSE}
spDat <-
catchDat %>%
inner_join(spList, c("Species" = "X3A_CODE"))
#
spCatch <-
spDat %>%
dplyr::mutate(English_name = ifelse(is.na(English_name), "not defined", English_name))
```
```{r figure4, echo = FALSE, include = TRUE, fig.cap= "Figure 4. Landings (tonnes) reported to ICES for the 10 species with the greatest gross tonneage within the Celtic Seas ecoregion (6a, 6b.2, 6b.NK, 7a, 7b, 7c.2, 7e, 7f, 7g, 7h, 7j.2, 7k.2)"}
#
spPlot <- spCatch %>%
group_by(Species) %>%
dplyr::summarize(spTotal = sum(VALUE, na.rm = TRUE)) %>% # Overall catch to order plot
arrange(-spTotal) %>%
dplyr::mutate(RANK = min_rank(desc(spTotal))) %>%
inner_join(spCatch, c("Species" = "Species")) %>%
dplyr::mutate(Species = replace(Species, RANK > 9, "OTHER"),
English_name = replace(English_name, RANK > 9, "OTHER")) %>%
group_by(YEAR, Species, English_name) %>%
dplyr::mutate(spCatch = sum(VALUE, na.rm = TRUE)) %>%
distinct(YEAR, Species)
#
spPlot$English_name <- factor(spPlot$English_name, levels = rev(unique(spPlot$English_name)))
myColors <- c("grey40", brewer.pal(length(unique(spPlot$English_name)) - 1, "Spectral"))
names(myColors) <- levels(spPlot$English_name)
#
ggplot(spPlot, aes(x = YEAR, y = spCatch)) +
geom_area(aes(fill = English_name, color = English_name), alpha = .8, position = "stack") +
scale_fill_manual(values = myColors) +
scale_color_manual(values = myColors) +
labs(x = "Year",
y = "Nominal Catch (tonnes)",
fill = "Common name",
color = "Common name") +
theme_bw()
# ggsave(filename = paste0(plotDir, "CS_FisheryOverview-figure4.png"), width = 6.5,
# height = 4.5)
```
## Figure 4 corrections
* Remove "nei" and "(=Poutassou)" type additions to the FAO species name list
```{r gearEffort, include = FALSE}
stecfCatchDat <-
# tt <-
stecfCatchDat %>%
# Filter(f = function(x)!all(is.na(x))) %>%
filter(reg_area %in% ecoAreaEffort) %>%
melt(id.vars = c("annex", "reg_area", "country", "reg_gear", "specon", "species"),
variable.name = "YEAR",
value.name = "VALUE") %>%
mutate(METRIC = as.character(gsub(".*\\s", "", YEAR)),
YEAR = as.numeric(gsub("\\s.+$", "", YEAR))) %>%
filter(METRIC == "L")
#
catchGear <- stecfCatchDat %>%
group_by(YEAR, reg_gear) %>%
dplyr::summarize(gearEffort = sum(VALUE, na.rm = T)) # %>% # Total annual catch
# Convert country codes to proper names
```
```{r figure5, echo = FALSE, include = TRUE, fig.cap= "Figure 5. Catch (tonnes) by gear reported to STECF within the Celtic Seas ecoregion (6 EU and 7a, 7b, 7c, 7e, 7f, 7g, 7h, 7j, 7k)"}
```
## Figure 5 corrections
* Find where this data is in STECF data...
* Metier overviews
## Table 1 will be an annex
* Add Fpa and Bpa as additional columns.
## Table will be number of stocks above and below reference points total and then divided into fishery guilds
## Figure YY
* No pair trawl
* Demersal trawl
## Figure 6 (split into 2)
* yellow should be red
* red should be grey
* Should we use catch?
* Should we repeat Fmsy with Fpa? - no
* Use landings for the time being
## Pie graph should be a table as a summary beneath the stock status (tick mark table)
## Figure 7
* Change the colors (red, green and grey). Yellow should be red
* Fishery guild not trophic guild
* Absolute bar graphs instead of log
* For the time being use landings
[Celtic Seas Fishery Advice](https://community.ices.dk/Advice/Advice2016/CelticSea/_layouts/15/WopiFrame.aspx?sourcedoc=/Advice/Advice2016/CelticSea/Draft_advice/CelticSeasEcoregion_FisheriesOverviews.docx&action=default)
For questions, please email <A HREF="mailto:[email protected]?subject=Nordic Council plots">[email protected]</A>.
<!-- ```{r guildlist, echo=FALSE, include=TRUE} -->
<!-- # -->
<!-- guildList <- read.csv("~/git/ices-dk/rStockOverview/fisheryGuild.csv") -->
<!-- # -->
<!-- guildList <- guildList %>% -->
<!-- rename(Stock = Stock.code, -->
<!-- GUILD = Fisheries.Guild) %>% -->
<!-- filter(GUILD %in% c("pelagic", "benthic", "demersal")) %>% -->
<!-- mutate(Stock = tolower(Stock), -->
<!-- Stock = gsub("[[:space:]]", "", Stock)) -->
<!-- # -->
<!-- overTable <- guildList %>% -->
<!-- inner_join(stockTable, c("Stock" = "STOCKID")) %>% -->
<!-- rename(ECOREGION = EcoRegion) %>% -->
<!-- distinct(ECOREGION, GUILD, Stock) %>% -->
<!-- select(ECOREGION, GUILD, Stock, FMSY, MSYBtrigger) %>% -->
<!-- filter(ECOREGION %in% c("North Sea", "Iceland and East Greenland", -->
<!-- "Widely distributed and migratory stocks", -->
<!-- "Baltic Sea", "Faroe Plateau Ecosystem", -->
<!-- "Barents Sea and Norwegian Sea")) %>% -->
<!-- filter(!is.na(FMSY) | !is.na(MSYBtrigger)) %>% -->
<!-- arrange(ECOREGION, GUILD) -->
<!-- # -->
<!-- knitr::kable(overTable, format="markdown") -->
<!-- ``` -->
<!-- ```{r stocktable, echo = FALSE} -->
<!-- # -->
<!-- df <- guildList %>% -->
<!-- inner_join(stockTable, c("Stock" = "STOCKID")) %>% -->
<!-- rename(ECOREGION = EcoRegion) %>% -->
<!-- filter(SpeciesName != "Psetta maxima (historic name)" & -->
<!-- Stock %in% unique(guildList$Stock) & -->
<!-- ECOREGION %in% c("North Sea", "Iceland and East Greenland", -->
<!-- "Widely distributed and migratory stocks", -->
<!-- "Baltic Sea", "Faroe Plateau Ecosystem", -->
<!-- "Barents Sea and Norwegian Sea")) %>% -->
<!-- mutate(fishingPressureDescription = gsub("Fishing Pressure: " , "", fishingPressureDescription), -->
<!-- fishingPressureDescription = gsub("Fishing pressure: " , "", fishingPressureDescription), -->
<!-- stockSizeDescription = ifelse(stockSizeDescription == "NA", "Stock Size: Relative", stockSizeDescription), -->
<!-- FmsyDescription = "FMSY", -->
<!-- stockSizeDescription = gsub("Stock Size: ", "", stockSizeDescription)) %>% -->
<!-- filter(stockSizeDescription != "B/BMSY" | -->
<!-- fishingPressureDescription != "F/FMSY") %>% -->
<!-- group_by(Stock) %>% -->
<!-- mutate(F_FMSY = F / FMSY, -->
<!-- SSB_MSYBtrigger = SSB / MSYBtrigger) %>% -->
<!-- melt(id.vars = c("AssessmentYear", "ECOREGION", "GUILD","Stock", "Year"), -->
<!-- measure.vars = c("F_FMSY", "SSB_MSYBtrigger"), -->
<!-- variable.name = "METRIC", -->
<!-- value.name = "VALUE") %>% -->
<!-- rename(STOCKID = Stock, -->
<!-- YEAR = Year, -->
<!-- stockValue = VALUE) %>% -->
<!-- filter(!is.na(stockValue)) %>% # remove NA VALUE -->
<!-- group_by(ECOREGION, GUILD, METRIC, YEAR) %>% -->
<!-- mutate(ecoGuildMean = mean(stockValue)) %>% -->
<!-- group_by(ECOREGION, METRIC, YEAR) %>% -->
<!-- mutate(ecoValue = mean(stockValue)) %>% -->
<!-- group_by(METRIC, GUILD, YEAR) %>% -->
<!-- mutate(allMean = mean(stockValue)) -->
<!-- write.csv(df, file = "~/git/ices-dk/rStockOverview/NordicCouncilRefPoints.csv", -->
<!-- row.names = FALSE) -->
<!-- # -->
<!-- ``` -->
<!-- ## Figure 1. ## -->
<!-- F/F~MSY~ and SSB/MSY B~trigger~ averaged by guild for all ecoregions. [Link to .png](https://github.com/ICES-dk/rStockOverview/blob/master/output/NordicCouncilRefPoints_ALL.png) -->
<!-- ```{r echo = FALSE, include = TRUE} -->
<!-- df %>% -->
<!-- ungroup() %>% -->
<!-- distinct(GUILD, METRIC, YEAR) %>% -->
<!-- ggplot(aes(x = YEAR, y = allMean, col = GUILD)) + -->
<!-- geom_line() + -->
<!-- geom_hline(yintercept = 1, col = "grey40", linetype = "dashed") + -->
<!-- # scale_y_continuous(limits = c(0, 3.2)) + -->
<!-- scale_color_manual(values = c("#7fc97f","#ef3b2c","#662506")) + -->
<!-- facet_grid(~METRIC) + -->
<!-- theme_bw() + -->
<!-- theme(legend.position = "bottom", -->
<!-- strip.text = element_text(size = 12, angle = 0, hjust = 0), -->
<!-- strip.background = element_blank(), -->
<!-- legend.key = element_rect(colour = NA)) + -->
<!-- labs(x = "Year", y = "Metric") -->
<!-- ggsave(filename = paste0(plotDir, "NordicCouncilRefPoints_ALL.png"), width = 6.5, -->
<!-- height = 4.5) -->
<!-- ``` -->
<!-- \pagebreak -->
<!-- ## Figure 2. ## -->
<!-- F/F~MSY~ and SSB/MSY B~trigger~ averaged for each ecoregion and guild. [Link to .png](https://github.com/ICES-dk/rStockOverview/blob/master/output/NordicCouncilRefPoints_ecoregion-guild.png) -->
<!-- ```{r echo = FALSE, include = TRUE} -->
<!-- df %>% -->
<!-- mutate(ECOGUILD = paste0(ECOREGION,", ", GUILD)) %>% -->
<!-- ungroup() %>% -->
<!-- # select(ECOGUILD, METRIC, YEAR, ecoGuildMean) %>% -->
<!-- distinct(ECOGUILD, METRIC, YEAR) %>% -->
<!-- filter(YEAR >= 1990) %>% -->
<!-- ggplot(aes(x = YEAR, y = ecoGuildMean, col = METRIC)) + -->
<!-- geom_line() + -->
<!-- geom_hline(yintercept = 1, col = "grey40", linetype = "dashed") + -->
<!-- # scale_y_continuous(limits = c(0, 3.2)) + -->
<!-- facet_grid(GUILD ~ ECOREGION) + -->
<!-- scale_color_manual(values = c("#386cb0","#fdb462")) + -->
<!-- theme_bw() + -->
<!-- theme(legend.position = "bottom", -->
<!-- strip.text = element_text(size = 6, angle = 0, hjust = 0), -->
<!-- axis.text.x = element_text(size = 6, angle = 45), -->
<!-- strip.background = element_blank(), -->
<!-- legend.key = element_rect(colour = NA)) + -->
<!-- labs(x = "Year", y = "Metric") -->
<!-- ggsave(filename = paste0(plotDir, "NordicCouncilRefPoints_ecoregion-guild.png"), width = 6.5, -->
<!-- height = 4.5) -->
<!-- ``` -->