dblogr.com/

Honeybee Production

Graphs of honeybee production using FAO data


Prepare Data

# devtools::install_github("derekmichaelwright/agData")
library(agData)
# Prep data
myCaption <- "www.dblogr.com/ or derekmichaelwright.github.io/dblogr/ | Data: FAOSTAT"
#
dd <- agData_FAO_Livestock %>% filter(Item == "Bees")

Global Colonies

# Prep data
xx <- dd %>% filter(Area == "World")
# Plot
mp <- ggplot(data = xx, aes(x = Year, y = Value / 1000000)) + 
  geom_col(fill = "darkgreen", alpha = 0.7) +
  scale_x_continuous(breaks = seq(1960, 2020, by = 5)) + 
  theme_agData() +
  labs(title = "Global Honey Bee Colonies", x = NULL,
       y = "Stocks (Millions)", caption = myCaption)
ggsave("honeybee_01.png", mp, width = 6, height = 4)

Regions

# Prep data
myAreas <- c("World", "Asia", "Africa", "South America", 
             "Northern America", "Europe")
myColors <- c("black", "darkgoldenrod2", "darkred", "steelblue", 
              "darkgreen", "darkblue")
xx <- dd %>% filter(Area %in% myAreas) %>% 
  mutate(Area = factor(Area, levels = myAreas))
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value / 1000000, fill = Area)) + 
  geom_col(alpha = 0.7) +
  facet_wrap(Area ~ ., scales = "free_y", ncol = 3) +
  scale_x_continuous(breaks = seq(1965, 2015, by = 10)) + 
  scale_fill_manual(values = myColors) +
  theme_agData(legend.position = "none") +
  labs(title = "Honey Bee Colonies", x = NULL,
       y = "Stocks (Millions)", caption = myCaption)
ggsave("honeybee_02.png", mp, width = 8, height = 4)

USA

# Prep data
xx <- dd %>% filter(Area == "USA")
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value / 1000000)) +
  geom_col(fill = "darkgreen", alpha = 0.7) +
  theme_agData() +
  labs(title = "USA Honey Bee Colonies", y = "Million Colonies",
       x = NULL, caption = myCaption)
ggsave("honeybee_03.png", mp, width = 6, height = 4)

Honeybees vs. Sugarbeet

# Prep data
x1 <- dd %>% rename(Beehives=Value)
x2 <- agData_FAO_Crops %>% 
  filter(Item == "Sugar beet", Measurement == "Production") %>%
  rename(Sugar.beet=Value)
xx <- left_join(x1, x2, by = c("Area","Year")) %>%
  filter(Area %in% c("Northern America", "Western Europe"))
# Plot
mp <- ggplot(xx, aes(x = Sugar.beet / 1000000, y = Beehives / 1000000)) +
  geom_path(alpha = 0.3) +
  geom_point(aes(color = Year), size = 2) +
  stat_smooth(geom = "line", method = "lm", size = 1.5, alpha = 0.5) +
  scale_color_gradient(low = "steelblue", high = "darkred") +
  facet_wrap(Area ~ ., scales = "free") +
  theme_agData() +
  labs(y = "Million Beehive Colonies", 
       x = "Million Tonnes of Sugar Beet",
       caption = myCaption)
ggsave("honeybee_04.png", mp, width = 8, height = 4)


dblogr.com/


© Derek Michael Wright