<commit_before>---
title: 'Not Mustard - Exploring McDonalds Reviews on Yelp with R'
subtitle: 'Leveraging tidyverse packages httr, stringr & purrr'
layout: post
tags: [r, rstats, shiny, food, tidyverse]
output: 
  html_document: 
  self_contained: no
big-img: /post_data/about-us_our-history_960x542.jpg
share-img: /post_data/not_hotdog.jpeg
social-share: true
---



## Introduction

McDonald's is a nostalgic component of America 🇺🇸 and a pioneer of fast food operations and real estate ventures, as depicted in the 2016 film, [_The Founder_](https://www.rottentomatoes.com/m/the_founder/), about <NAME>. As a kid I traveled to different McDonald's across the east coast and noticed a difference in the [classic hamburger](https://www.mcdonalds.com/us/en-us/full-menu/burgers.html) preparation for adding mustard (i.e. in Maryland and not in Upstate New York). After some Google research, I noticed others had documented the [regional differences](http://aht.seriouseats.com/2010/03/dear-aht-differences-in-regional-mustard-use-on-mcdonalds-hamburgers.html) in the use of mustard and but no aggregated data set existed detailing which McDonald's added mustard to their hamburgers.

![](https://media.giphy.com/media/37NQLccUA0lmo/giphy.gif)

I hypothesized that these deviations in food prep could be identified from [yelp.com](https://www.yelp.com/) reviews. The process below explains the approaches I took to gather data from the web with the yelp API and the development of a `shiny` web application which detects string patterns in reviews for the keyword 'mustard' for a specific McDonald's.


## API Process

This script highly references <NAME>'s [`yelpr`](https://github.com/jennybc/yelpr) example!
<commit_msg>fix yaml<commit_after>---
title: 'Not Mustard - Exploring McDonalds Reviews on Yelp with R'
subtitle: 'Leveraging tidyverse packages httr, stringr & purrr'
layout: post
tags: [r, rstats, shiny, food, tidyverse]
output: 
  html_document: 
  self_contained: no
bigimg: /post_data/about-us_our-history_960x542.jpg
share-img: /post_data/not_hotdog.jpeg
social-share: true
---



## Introduction

McDonald's is a nostalgic component of America 🇺🇸 and a pioneer of fast food operations and real estate ventures, as depicted in the 2016 film, [_The Founder_](https://www.rottentomatoes.com/m/the_founder/), about <NAME>. As a kid I traveled to different McDonald's across the east coast and noticed a difference in the [classic hamburger](https://www.mcdonalds.com/us/en-us/full-menu/burgers.html) preparation for adding mustard (i.e. in Maryland and not in Upstate New York). After some Google research, I noticed others had documented the [regional differences](http://aht.seriouseats.com/2010/03/dear-aht-differences-in-regional-mustard-use-on-mcdonalds-hamburgers.html) in the use of mustard and but no aggregated data set existed detailing which McDonald's added mustard to their hamburgers.

![](https://media.giphy.com/media/37NQLccUA0lmo/giphy.gif)

I hypothesized that these deviations in food prep could be identified from [yelp.com](https://www.yelp.com/) reviews. The process below explains the approaches I took to gather data from the web with the yelp API and the development of a `shiny` web application which detects string patterns in reviews for the keyword 'mustard' for a specific McDonald's.


## API Process

This script highly references Jenny Bryan's [`yelpr`](https://github.com/jennybc/yelpr) example!

{'fraction_non_alphanumeric': 0.09375907111756168, 'fraction_numerical': 0.011030478955007257, 'mean_word_length': 4.840677966101695, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 10, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4028444', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1021, 'n_words': 392}