Dewey’s Pizza and Fireside Pizza are two well-regarded competitors located in Clifton. I was curious to see how both restaurants’ customer reviews have changed since the beginning of the COVID-19 pandemic in early 2020. In order to perform analysis on this subject, I converted 100 yelp reviews for each restaurant into one dataframe. My final dataframe consists of 8,159 rows representing each word used throughout the 200 total customer reviews. This unique setup ultimately allowed me to pair the data with the NRC sentiment dictionary to assess the feelings and emotions of the customers for both restaurants in my analysis and identify which restaurant has handled the COVID-19 pandemic more effectively.
library(tidyverse)
library(lubridate)
library(DT)
library(knitr)
library(textdata)
library(tidytext)
Have customers felt more of a sense of fear at Dewey’s Pizza or Fireside Pizza?
By looking at the customer word count of the words associated with the feeling of fear, this will give one a better sense as to which restaurant has fostered a safer eating environment.
To go about solving this problem, I decided to use a bar chart. I first joined my dataframe with the nrc dictionary by “word”. Next, I filtered by the sentiment of fear, grouped by sentiment and attraction, and utilized the summarize function to calculate the total word count in the dataframe. Lastly, I implemented a ggplot bar chart with sentiment on my x-axis, word count on my y-axis, and the the fill set equal to attraction. This ultimately resulted in the Fear Breakdown by Pizza Attraction.
Result: When observing he bar chart, it appears that customers felt more of a sense of fear at Dewey’s Pizza (around 100 words associated with fear) compared to Fireside Pizza (around 75 words associated with feelings of fear). Looking at the words associated with fear themselves in the next analysis may allow one to see if Dewey’s does provoke more feelings of fear compared to Fireside Pizza.
What words have reviewers been using to express their feelings of fear at these two restaurants?
By looking at the actual words associated with feelings of fear, we can get a better understanding of whether Dewey’s does make more customers feel a sense of fear compared to Fireside Pizza
To go about solving this problem, I decided to use a table. I first joined my dataframe with the nrc dictionary by “word”. Next, I selected the word, sentiment, and attraction variables and filtered by the sentiment of fear. Lastly, I arranged the data alphabetically by word and utilized the kable function to output an aesthetically pleasing table.
Results: Saying that Dewey’s pizza makes more customers feel the emotion of fear may not be as clear as was previously conveyed. The word “bad” is associated with the fear sentiment and it comes up a number of times for both restaurants. The most interesting finding is the word “chicken” was the most used word associated with the fear sentiment. With that being said, “chicken” was used several times more in Dewey’s Pizza Reviews compared to Fireside Reviews. Ultimately, relying on the word count from Analysis 1 would not have been the best approach to answering the original problem.
| word | sentiment | attraction |
|---|---|---|
| abandoned | fear | Fireside Pizza |
| accident | fear | Fireside Pizza |
| avoid | fear | Dewey’s Pizza |
| avoid | fear | Dewey’s Pizza |
| awful | fear | Dewey’s Pizza |
| awful | fear | Fireside Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Fireside Pizza |
| bad | fear | Fireside Pizza |
| bad | fear | Fireside Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Dewey’s Pizza |
| bad | fear | Fireside Pizza |
| bomb | fear | Dewey’s Pizza |
| bomb | fear | Fireside Pizza |
| bomber | fear | Dewey’s Pizza |
| bomber | fear | Dewey’s Pizza |
| bomber | fear | Dewey’s Pizza |
| bomber | fear | Dewey’s Pizza |
| bomber | fear | Dewey’s Pizza |
| broke | fear | Fireside Pizza |
| cautious | fear | Dewey’s Pizza |
| change | fear | Dewey’s Pizza |
| change | fear | Fireside Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Fireside Pizza |
| chicken | fear | Dewey’s Pizza |
| chicken | fear | Fireside Pizza |
| coma | fear | Dewey’s Pizza |
| concerned | fear | Fireside Pizza |
| confidence | fear | Dewey’s Pizza |
| crazy | fear | Dewey’s Pizza |
| crazy | fear | Dewey’s Pizza |
| crazy | fear | Dewey’s Pizza |
| crushed | fear | Dewey’s Pizza |
| dangerous | fear | Fireside Pizza |
| dangerous | fear | Dewey’s Pizza |
| devil | fear | Dewey’s Pizza |
| die | fear | Dewey’s Pizza |
| die | fear | Dewey’s Pizza |
| die | fear | Dewey’s Pizza |
| difficult | fear | Dewey’s Pizza |
| difficult | fear | Fireside Pizza |
| difficult | fear | Dewey’s Pizza |
| difficult | fear | Dewey’s Pizza |
| disgusting | fear | Fireside Pizza |
| disgusting | fear | Fireside Pizza |
| displeased | fear | Fireside Pizza |
| doubt | fear | Fireside Pizza |
| doubt | fear | Fireside Pizza |
| doubt | fear | Fireside Pizza |
| dying | fear | Fireside Pizza |
| feeling | fear | Dewey’s Pizza |
| fierce | fear | Dewey’s Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Dewey’s Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| fire | fear | Fireside Pizza |
| giant | fear | Fireside Pizza |
| giant | fear | Fireside Pizza |
| hanging | fear | Fireside Pizza |
| hanging | fear | Fireside Pizza |
| hate | fear | Dewey’s Pizza |
| hell | fear | Dewey’s Pizza |
| hell | fear | Dewey’s Pizza |
| hell | fear | Fireside Pizza |
| hide | fear | Fireside Pizza |
| homework | fear | Fireside Pizza |
| hurt | fear | Fireside Pizza |
| imprisoned | fear | Fireside Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| inferno | fear | Dewey’s Pizza |
| intense | fear | Dewey’s Pizza |
| lines | fear | Dewey’s Pizza |
| mighty | fear | Dewey’s Pizza |
| mighty | fear | Dewey’s Pizza |
| mislead | fear | Fireside Pizza |
| missing | fear | Fireside Pizza |
| opera | fear | Dewey’s Pizza |
| operation | fear | Dewey’s Pizza |
| pandemic | fear | Dewey’s Pizza |
| pandemic | fear | Dewey’s Pizza |
| powerful | fear | Fireside Pizza |
| punch | fear | Dewey’s Pizza |
| punch | fear | Fireside Pizza |
| punch | fear | Fireside Pizza |
| revenge | fear | Dewey’s Pizza |
| revenge | fear | Dewey’s Pizza |
| revenge | fear | Dewey’s Pizza |
| revenge | fear | Dewey’s Pizza |
| revenge | fear | Dewey’s Pizza |
| ruined | fear | Fireside Pizza |
| scream | fear | Dewey’s Pizza |
| shady | fear | Fireside Pizza |
| shame | fear | Fireside Pizza |
| shame | fear | Dewey’s Pizza |
| shell | fear | Dewey’s Pizza |
| shot | fear | Fireside Pizza |
| shot | fear | Fireside Pizza |
| steal | fear | Dewey’s Pizza |
| stranger | fear | Dewey’s Pizza |
| struggle | fear | Dewey’s Pizza |
| surgery | fear | Dewey’s Pizza |
| treat | fear | Dewey’s Pizza |
| treat | fear | Fireside Pizza |
| unfriendly | fear | Fireside Pizza |
| unsafe | fear | Fireside Pizza |
| warned | fear | Dewey’s Pizza |
| warning | fear | Dewey’s Pizza |
| watch | fear | Dewey’s Pizza |
| watch | fear | Fireside Pizza |
| watch | fear | Fireside Pizza |
| watch | fear | Fireside Pizza |
| watch | fear | Dewey’s Pizza |
| worse | fear | Dewey’s Pizza |
| worse | fear | Fireside Pizza |
| wound | fear | Fireside Pizza |
| yelp | fear | Fireside Pizza |
| yelp | fear | Dewey’s Pizza |
| yelp | fear | Dewey’s Pizza |
| yelp | fear | Fireside Pizza |
| yelp | fear | Fireside Pizza |
| yelp | fear | Fireside Pizza |
| yelp | fear | Fireside Pizza |
Have the reviews been more positive or negative since the beginning of the pandemic for each restaurant?
By looking at the customer word count of the words associated with positive and negative feelings before and during the COVID-19 pandemic, this will give one a better sense as to which restaurant is handling the COVID-19 situation more effectively.
To go about solving this problem, I decided to use 2 bar charts. FOr my first chart, I joined my dataframe with the nrc dictionary by “word”. Next, I grouped by the sentiment and attraction variables, filtered out all of the rows before 2020, and filtered by the positive and negative sentiments. Then, I utilized the summarize function to calculate the total word count in the dataframe. Lastly, I implemented a ggplot bar chart with sentiment on my x-axis, word count on my y-axis, and the the fill set equal to attraction. This ultimately resulted in the positive and negative breakdown of by attraction pre COVID-19. I repeated the same process for my second chart, but filtered out all of the years before 2020 to give me the total positive and negative customer word count for each restaurant during COVID-19.
Results: When looking at the pre COVID-19 graph, there are significantly more positive word counts for both restaurants than negative, however, Dewey’s Pizza had a positive word count of around 600 compared to Fireside Pizza’s count of around 400. Now, since the onset of the pandemic, Fireside pizza has had more than twice the amount of positive words (around 105 words) compared to Dewey’s Pizza (around 45 words). Further analysis on this subject can be conducted, but one can begin to make the assumption that Fireside Pizza has potentially handled the COVID-19 situation better than Dewey’s Pizza at this time.