Genetically Engineered Crop Production in USA
Graphs of GE crop production using USDA data
Data
Prepare Data
# devtools::install_github("derekmichaelwright/agData")
library(agData)
<- "www.dblogr.com/ or derekmichaelwright.github.io/dblogr/ | Data: USDA"
myCaption #
<- agData_USDA_GE_Crops dd
All
# Prep data
<- dd %>%
xx filter(Area == "U.S.", Measurement == "All GE varieties") %>%
mutate(Item = gsub("Genetically engineered \\(GE\\)", "GE", Item),
Item = gsub(" varieties", "", Item))
<- xx %>% top_n(1, Year) %>% pull(Value)
xE # Plot
<- ggplot(xx, aes(x = Year, y = Value, color = Item)) +
mp 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
<- dd %>%
xx filter(Area != "U.S.", Measurement == "All GE varieties") %>%
mutate(Item = gsub("Genetically engineered \\(GE\\)", "GE", Item))
# Plot
<- ggplot(xx, aes(x = Year, y = Value, color = Item)) +
mp 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)
Maize
# Prep data
<- dd %>%
xx filter(Area == "U.S.", Item == "Genetically engineered (GE) corn varieties")
<- xx %>% top_n(1, Year) %>% pull(Value)
xE # Plot
<- ggplot(xx, aes(x = Year, y = Value, color = Measurement)) +
mp 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
<- dd %>%
xx filter(Area == "U.S.",
== "Genetically engineered (GE) upland cotton varieties")
Item <- xx %>% top_n(1, Year) %>% pull(Value)
xE # Plot
<- ggplot(xx, aes(x = Year, y = Value, color = Measurement)) +
mp 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
<- dd %>%
xx filter(Area == "U.S.",
== "Genetically engineered (GE) soybean varieties")
Item <- xx %>% top_n(1, Year) %>% pull(Value)
xE # Plot
<- ggplot(xx, aes(x = Year, y = Value,
mp 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
<- dd %>%
xx filter(Area == "Georgia",
== "Genetically engineered (GE) upland cotton varieties")
Item <- xx %>% top_n(1, Year) %>% pull(Value)
xE # Plot
<- ggplot(xx, aes(x = Year, y = Value, color = Measurement)) +
mp 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)