Genetically Engineered Crop Production in USA
Graphs of GE crop production using USDA data
Data
Prepare Data
myCaption <- "www.dblogr.com/ or derekmichaelwright.github.io/dblogr/ | Data: USDA"
#
dd <- agData_USDA_GE_Crops
All
# Prep data
xx <- dd %>%
filter(Area == "U.S.", Measurement == "All GE varieties") %>%
mutate(Item = gsub("Genetically engineered \\(GE\\)", "GE", Item),
Item = gsub(" varieties", "", Item))
xE <- xx %>% top_n(1, Year) %>% pull(Value)
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value, color = Item)) +
geom_line(size = 1.5, alpha = 0.7) +
scale_color_manual(name = NULL, values = agData_Colors[c(2,1,3)]) +
scale_y_continuous(breaks = seq(0, 100, by = 10),
sec.axis = sec_axis(~ ., breaks = xE[c(1,2)])) +
coord_cartesian(xlim = c(min(xx$Year)+0.5, max(xx$Year)-0.8)) +
theme_agData(legend.position = "bottom") +
labs(title = "USA GE Crop Adoption",
y = "Percent", x = NULL, caption = myCaption)
ggsave("ge_crops_usa_01.png", mp, width = 6, height = 4)
States
# Prep data
xx <- dd %>%
filter(Area != "U.S.", Measurement == "All GE varieties") %>%
mutate(Item = gsub("Genetically engineered \\(GE\\)", "GE", Item))
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value, color = Item)) +
geom_line(size = 1.5, alpha = 0.7) +
facet_wrap(Area ~ ., ncol = 6) +
scale_color_manual(name = NULL, values = agData_Colors[c(2,1,3)]) +
theme_agData(legend.position = "bottom",
axis.text.x = element_text(angle = 45, hjust = 1)) +
labs(title = "USA GE Crop Adoption",
y = "Percent", x = NULL, caption = myCaption)
ggsave("ge_crops_usa_02.png", mp, width = 10, height = 8)
Crops
Maize
# Prep data
xx <- dd %>%
filter(Area == "U.S.", Item == "Genetically engineered (GE) corn varieties")
xE <- xx %>% top_n(1, Year) %>% pull(Value)
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value, color = Measurement)) +
geom_line(size = 1.5, alpha = 0.7) +
scale_color_manual(name = NULL, values = agData_Colors) +
scale_y_continuous(breaks = seq(0, 100, by = 10),
sec.axis = sec_axis(~ ., breaks = xE)) +
coord_cartesian(xlim = c(min(xx$Year)+0.5, max(xx$Year)-0.8)) +
theme_agData(legend.position = "bottom") +
labs(title = "US GE Trait Adoption",
subtitle = "Genetically engineered (GE) corn varieties",
y = "Percent", x = NULL, caption = myCaption)
ggsave("ge_crops_usa_03.png", mp, width = 7, height = 4)
Cotton
# Prep data
xx <- dd %>%
filter(Area == "U.S.",
Item == "Genetically engineered (GE) upland cotton varieties")
xE <- xx %>% top_n(1, Year) %>% pull(Value)
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value, color = Measurement)) +
geom_line(size = 1.5, alpha = 0.7) +
scale_color_manual(name = NULL, values = agData_Colors) +
scale_y_continuous(breaks = seq(0, 100, by = 10),
sec.axis = sec_axis(~ ., breaks = xE)) +
coord_cartesian(xlim = c(min(xx$Year)+0.5, max(xx$Year)-0.8)) +
theme_agData(legend.position = "bottom") +
labs(title = "US GE Trait Adoption",
subtitle = "Genetically engineered (GE) upland cotton varieties",
y = "Percent", x = NULL, caption = myCaption)
ggsave("ge_crops_usa_04.png", mp, width = 7, height = 4)
Soybeans
# Prep data
xx <- dd %>%
filter(Area == "U.S.",
Item == "Genetically engineered (GE) soybean varieties")
xE <- xx %>% top_n(1, Year) %>% pull(Value)
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value,
color = Measurement, size = Measurement)) +
geom_line(alpha = 0.7) +
scale_color_manual(name = NULL, values = agData_Colors) +
scale_size_manual(values = c(2,1), guide = F) +
scale_y_continuous(breaks = seq(0, 100, by = 10),
sec.axis = sec_axis(~ ., breaks = xE)) +
coord_cartesian(xlim = c(min(xx$Year)+0.5, max(xx$Year)-0.8)) +
theme_agData(legend.position = "bottom") +
labs(title = "US GE Trait Adoption",
subtitle = "Genetically engineered (GE) soybean varieties",
y = "Percent", x = NULL, caption = myCaption)
ggsave("ge_crops_usa_05.png", mp, width = 7, height = 4)
Georgia
# Prep data
xx <- dd %>%
filter(Area == "Georgia",
Item == "Genetically engineered (GE) upland cotton varieties")
xE <- xx %>% top_n(1, Year) %>% pull(Value)
# Plot
mp <- ggplot(xx, aes(x = Year, y = Value, color = Measurement)) +
geom_line(size = 1.5, alpha = 0.7) +
scale_color_manual(name = NULL, values = agData_Colors) +
scale_y_continuous(breaks = seq(0, 100, by = 10),
sec.axis = sec_axis(~ ., breaks = xE)) +
coord_cartesian(xlim = c(min(xx$Year)+0.5, max(xx$Year)-0.8)) +
theme_agData(legend.position = "bottom") +
labs(title = "Georgia GE Trait Adoption",
subtitle = "Genetically engineered (GE) upland cotton varieties",
y = "Percent", x = NULL, caption = myCaption)
ggsave("ge_crops_usa_06.png", mp, width = 7, height = 4)