---
title: "Lab 7.2 - Fisheries"
author: "Author Goes Here"
date: "Semester Goes Here"
output: html_document
---

```{r setup, include = FALSE}
library(tidyverse)
```

### Fisheries

Fisheries and Aquaculture Department of the Food and 
Agriculture Organization of the United Nations collects data on fisheries 
production of countries. [This Wikipedia page](https://en.wikipedia.org/wiki/Fishing_industry_by_country) 
lists fishery production of countries for 2016. For each country tonnage from 
capture and aquaculture are listed. Note that countries whose total harvest was 
less than 100,000 tons are not included in the visualization.

A researcher shared with you the following visualization they created based on 
these data `r emo::ji("flushed")`.

```{r echo=FALSE, fig.fullwidth=TRUE}
knitr::include_graphics("images/fisheries.png")
```

7. Can you help them make improve it? First, brainstorm how you would improve it. Then create the improved visualization and write up the changes/decisions you made as bullet points. It’s ok if some of your improvements are aspirational, i.e. you don’t know how to implement it, but you think it’s a good idea.

8. Create a new data visualisation for these data that implements the improvements you proposed in the previous exercise (or many of them as you can).


```{r load-data-fisheries, message = FALSE}
fisheries <- read_csv(here("data/fisheries.csv"))
```

```{r include=FALSE}
fisheries %>% 
  select(!total) %>% 
  pivot_longer(!country) %>% 
  mutate(country = fct_other(country, keep = c("China", "Indonesia", "India", "Peru"))) %>% 
  ggplot(aes(x = name, y = value, fill = country)) +
    geom_col(position = "fill")
```


```{r include = FALSE}
fisheries %>% 
  pivot_longer(!c(country, total)) %>% 
  ggplot(aes(y = #fct_rev(country),
             fct_lump_n(country, n = 20, w = total),
             x = value, fill = name)) +
    geom_col()
```

