R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. Note: this analysis was performed using the open source software R and Rstudio. ## Objective The objective of this applied project is to explain the price of avocados using some basic descriptive analysis.This analysis can be used by producers, retailers, and groceries to make decisions about their pricing strategies, advertising strategies, and supply chain stratgies among others. Some additional analysis will follow after this episode. Your feedback is highly appreciated. ## Dataset - weekly avocado sales and price data from the Hass Avocado Board website This data was downloaded from the Hass Avocado Board website in May of 2018 & compiled into a single CSV. Here’s how the Hass Avocado Board describes the data on their website: The table below represents weekly retail scan data for National retail volume (units) and price. Retail scan data comes directly from retailers’ cash registers based on actual retail sales of Hass avocados. Starting in 2013, the table below reflects an expanded, multi-outlet retail data set. Multi-outlet reporting includes an aggregation of the following channels: grocery, mass, club, drug, dollar and military. The Average Price (of avocados) in the table reflects a per unit (per avocado) cost, even when multiple units (avocados) are sold in bags. The Product Lookup codes (PLU’s) in the table are only for Hass avocados. Other varieties of avocados (e.g. greenskins) are not included in this table.

data <-read.csv('avocado.csv')

# Let's build a simple histogram
hist(data$average_price ,
main = "Histogram of average_price",
xlab = "Price in USD (US Dollar)")

library(ggplot2)
ggplot(data, aes(x = average_price, fill = type)) +
geom_histogram(bins = 30, col = "purple") +
scale_fill_manual(values = c("pink", "gray")) +
ggtitle("Frequency of Average Price - Oragnic vs. Conventional")

# Simple EFA with ggplot
ggplot() +
geom_col(data, mapping = aes(x = reorder(geography,total_volume),
y = total_volume, fill = year )) +
xlab("geography")+
ylab("total_volume")+
theme(axis.text.x = element_text(angle = 90, size = 7))

# Sample response for year 2017 - The plot shows that Los Angels has the highest amount of sales in 2017.

Question 1

Based on the histogram, the organic avocados tend to have higher prices compared to the conventional avocados. The conventional bars seem to be more concentrated in the at lower prices while the organic bars are more concentrated at the higher prices. This would make sense since organic avocados are more expensive to grow and produce.

Question 2

Los Angeles had significantly more sales of organic and conventional Haas avocados for 2017 and 2018 compared to other cities. One possible reason could be for the city’s size and high demand. There could also be more trends in Los Angeles for healthy eating habits.

Question 3

One reason different stakeholders could benefit from this research is by understanding pricing trends. This helps with formulating strategies for pricing as well as managing inventory. Another reason is locating high-demand areas to concentrate more supply towards. Another reason is by understanding price differences and availability, consumers can make informed purchasing decisions.