Avocados have become a staple food item for many households due to their nutritional value and versatility in various dishes. In recent years, there has been a growing trend towards organic produce as consumers become more health-conscious and environmentally aware. This analysis aims to compare the average prices of organic and conventional avocados over a four-year period from 2015 to 2018. By examining the price trends, we can gain insights into consumer preferences and market dynamics within the avocado industry.
The dataset used for this analysis contains price data for avocados from 2015 to 2018, segmented by type (organic vs. conventional). Each entry includes information such as date, average price, total volume sold, and region.
We hypothesize that organic avocados will have a higher average price compared to conventional avocados due to the perceived health benefits and production methods associated with organic farming.
av <- read.csv("avocado.csv")
av$Date <- ymd(av$Date)
trend<-aggregate(AveragePrice~Date+type,data=av,mean)
ggplotly(ggplot(trend,aes(x=Date,y=AveragePrice,group=type,color=type))+
geom_line()+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
geom_smooth(method=lm))
## `geom_smooth()` using formula = 'y ~ x'