10-15 bucks!

Posted on May 10, 2016

Contributed by Adam Cone.He  is currently in the NYC Data Science Academy 12 week full time Data Science Bootcamp program taking place between April 11th to July 1st, 2016. This post is based on his second class project - R Shiny (due on the 4th week of the program). The video of his presentation is here:

Open Produce is small grocery store on the south side of Chicago. The owners wrote their own Point-of-Sale (POS) system to collect data relating to deveries, inventory, sales, and other aspects of the business. Open Produce made some of their total revenue data available in an interactive format  on their website:


The overall revenue trend seems pretty consistently positive since Open Produce began taking data. Kudos to Open Produce! Mazel tov! For my Shiny project, I wanted also look at overall revenue. Specifically, I wanted to provide both Open Produce staff and customers a free an easy way to visualize the data themselves to gain insights. To this end, I developed the following Shiny app, hosted by Shinyapps.io here:


To generate this app, I first prepared the data with an R file, then wrote the app itself using three more R files: ui.R, server.R, and helpers.R. The data wrangling code is:

After this data wrangling, my data looked like this:


Now, for the Shiny code. Here's the ui.R code:

Here's the server.R code:

And here's the helpers.R code:

Playing around with the app myself led me to two insights that I didn't have beforehand, although I had spent a lot of time with the data. First, I noticed that the total Open Produce revenue, in approximately 4 month bins, essentially quadrupled between the first bin and the final bin for the 6.5 years of data I had ( about $100,000 to $400,000 total revenue over each four-month period). In addition, the growth was roughly constant over the intervening ~6 years.


So, I was interested in sub-categories that may not obey this trend. One was revenue collected from items purchased with Payment Type Credit/Debit only:


It seems that while overall revenue increased smoothly by a factor of about 4, Credit/Debit purchases increased smoothly from about $40,000 to $250,000, or a factor of 6.25 over the same period. It appears to me that Credit/Debit purchases were disproportionately responsible for the overall revenue increase.

In addition, narrowing the Product Unit Price Range ($) to $10-$15 was even more extreme:


The growth in products with unit prices from $10-15 was enormous. There was essentially no revenue from these products until about July 2010, when they started steadily increasing. After that, the growth seemed to spike in early 2015. While this data was available before I had looked at the Shiny app, I didn't make this connection until I could visualize the data. Also, using Shiny, I was able to pinpoint that the majority of revenue generated from $10-15 items was sold in the middle Time of Day: 2:00pm-8:00pm.

If I were to develop this app further, besides prettying it up a bit, I would want to include more item categories, such as dairy/frozen/drinks, etc. Also, it would be interesting to have data about where the items were physically in the store when they were purchased.

About Author

Adam Cone

Adam Cone received his BA with honors in Math from NYU, where he conducted original research in computational neural science and experimental fluid mechanics. He received his MA in Applied Math from UCLA, concentrating in differential equations and...
View all posts by Adam Cone >

Related Articles

Leave a Comment

dungeon hunter 5 hack 2016 July 9, 2016
This is the appropriate blog for anyone who desires to find out about this matter. You realize so much its almost hard to argue with you (not that I actually would desire… HaHa). You undoubtedly set a brand new spin on a topic thats been written about for years. Amazing stuff, just excellent!
Chang June 29, 2016
I was waiting for this kind of subject. Thank you very much for the place.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI