Skip to content

Commit 8a52639

Browse files
author
Carly Lovas
committed
plotting vignette edits
1 parent 13cc991 commit 8a52639

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

R/garfo_landings.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ plot_landings_trends <- function(species = "all", data = "landings") {
9494
# Build plots only for relevant species
9595
plots <- data |>
9696
dplyr::rename("landings" = "land") |>
97-
dplyr::rename("revenue" = "value")
97+
dplyr::rename("revenue" = "value") |>
9898
tidyr::pivot_longer(
9999
cols = c(landings, revenue),
100100
names_to = "metric",
101101
values_to = "value"
102102
) |>
103103
dplyr::group_by(year, comname, state_full, metric) |>
104-
dplyr::summarise(total = sum(revenue), .groups = "drop") |>
104+
dplyr::summarise(total = sum(value), .groups = "drop") |>
105105
dplyr::group_by(comname) |>
106106
tidyr::nest() |>
107107
dplyr::mutate(
@@ -177,13 +177,14 @@ plot_state_landings <- function(species = "all", data = "landings") {
177177
# Build plots only for relevant species
178178
plots <- data |>
179179
dplyr::rename("landings" = "land") |>
180+
dplyr::rename("revenue" = "value") |>
180181
tidyr::pivot_longer(
181182
cols = c(landings, revenue),
182183
names_to = "metric",
183184
values_to = "value"
184185
) |>
185186
dplyr::group_by(year, comname, state_full, metric) |>
186-
dplyr::summarise(state_revenue = sum(revenue, na.rm = T), .groups = "drop") |>
187+
dplyr::summarise(state_revenue = sum(value, na.rm = T), .groups = "drop") |>
187188
dplyr::ungroup() |>
188189
dplyr::group_by(year, comname, metric) |>
189190
dplyr::mutate(total_revenue = sum(state_revenue, na.rm = T),
@@ -267,13 +268,14 @@ plot_council_landings <- function(species = "all", data = "landings") {
267268
# Build plots only for relevant species
268269
plots <- data |>
269270
dplyr::rename("landings" = "land") |>
271+
dplyr::rename("revenue" = "value") |>
270272
tidyr::pivot_longer(
271273
cols = c(landings, revenue),
272274
names_to = "metric",
273275
values_to = "value"
274276
) |>
275277
dplyr::group_by(year, comname, council, metric) |>
276-
dplyr::summarise(council_revenue = sum(revenue, na.rm = T), .groups = "drop") |>
278+
dplyr::summarise(council_revenue = sum(value, na.rm = T), .groups = "drop") |>
277279
dplyr::ungroup() |>
278280
dplyr::group_by(year, comname, metric) |>
279281
dplyr::mutate(total_revenue = sum(council_revenue, na.rm = T),
63.6 KB
Loading
63.7 KB
Loading

vignettes/plotting_functions.qmd

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,16 @@ plot_nefsc_edges(species = "summer flounder", data = nefsc)
192192
#| out-height: 400px
193193
knitr::include_graphics(here::here("images/summer flounder/summer flounder edges.png"))
194194
```
195-
195+
```r
196+
plot_council_biomass(spieces = "summer flounder", data = nefsc)
197+
```
198+
```{r}
199+
#| label: trawl council prop
200+
#| fig-align: center
201+
#| out-width: 500px
202+
#| out-height: 500px
203+
knitr::include_graphics(here::here("images/summer flounder/summer flounder council biomass proportion.png"))
204+
```
196205
197206
## Marine Recreational Information Program
198207
### Catch estimates

0 commit comments

Comments
 (0)