Egg prices in the USA are high right now, mostly due to supply issues caused by bird flu outbreaks. I was interested in how prices compare to egg prices in NZ, which have been high since battery farms bans went into effect in 2022.
The data for these plots came from StatsNZ and the US Bureau of Labor Statistics and required a bit of wrangling to make the formats consistent. You can find the code that I wrote to read in and clean the egg data in this .R script
The Quarto panel tabset is a nice way of comparing different plot options here. I think the smooth option looks better with slightly transparent points.
eggs %>%ggplot(aes(x = date, y = price, colour = currency)) +geom_point() +geom_line() +scale_colour_brewer(palette ="Dark2", name ="Country", labels =c("NZ", "USA")) +theme_minimal() +labs(y ="Price per dozen ($)", x ="Year", title ="Egg prices (per dozen) over time", caption ="NZ Data from StatsNZ; \nUS Data from Bureau of Labor Statistics")
eggs %>%ggplot(aes(x = date, y = price, colour = currency)) +geom_point(alpha =0.5) +geom_smooth(se =FALSE, na.rm =TRUE) +scale_colour_brewer(palette ="Dark2", name ="Country", labels =c("NZ", "USA")) +theme_minimal() +labs(y ="Price per dozen ($)", x ="Year", title ="Egg prices (per dozen) over time", caption ="NZ Data from StatsNZ; \nUS Data from Bureau of Labor Statistics")