The Data

The data this week comes from Our World in Data.

Hannah Ritchie and Max Roser (2021) - “Forests and Deforestation”. Published online at OurWorldInData.org. Retrieved from: ‘https://ourworldindata.org/forests-and-deforestation’ [Online Resource]

forest <- read_csv("forest.csv")
brazil_loss <- read_csv("brazil_loss.csv")
deforestation_by_source <- read_csv("deforestation_by_source.csv")
forest_area <- read_csv("forest_area.csv")
soybean_use <- read_csv("soybean_use.csv")
vegetable_oil <- read_csv("vegetable_oil.csv")

Brazil Loss

The plot below provides each dot representing 1000s of hectares (?) of loss, colored by how/why, displayed over time.

brazil <- brazil_loss %>%
  pivot_longer(cols = commercial_crops:small_scale_clearing,
               names_to = "why_loss",
               values_to = "loss_raw") %>%
  mutate(loss = round(loss_raw/10000)) %>%
  mutate(year = as.factor(year))

brazil_long <- brazil %>%
  uncount(weights = loss)
brazil_long %>%
  count(year, why_loss) %>%
  ggplot(aes(values = n, fill = why_loss)) +
  waffle::geom_waffle(flip = TRUE, color = "white", n_rows = 4, size = 0.2) +
  facet_wrap(~ year, nrow = 1, strip.position = "bottom") +
  theme(
    axis.ticks.x = element_blank(),
    axis.text.x = element_blank(),
    legend.key = element_blank(),
    plot.title = element_text(size = 25),
    legend.position = "top",
    plot.caption = element_text(color = "black", size = 13)) +
  labs(
    fill = "",
    title = "Changes over time and reasons for deforestation in Brazil",
    caption = "Tidy Tuesday Plot: @hardin47 | Data: Deforestation") +
  guides(fill = guide_legend(nrow = 2)) 

praise()
## [1] "You are perfect!"