570 min read

I wanted to learn how to use highcharter to make a map like this one, so I figured I’d use McDonalds store locations to recreate a similar product. Luckily, mapping these stores is not an original idea and someone already scraped the data from McDonalds website in 2014. Since I couldn’t get the geojson file to play nice in R, I used ConvertCSV to get it in a flat file and ran the R code found later in this post.

The map above isnt too suprising, it makes sense that there are more McDonalds stores in high density counties. The top 5 are:

## county_name state stores ## 1: Los Angeles County CA 351 ## 2: Cook County IL 233 ## 3: Harris County TX 211 ## 4: Maricopa County AZ 171 ## 5: Dallas County TX 122

Let’s see how may stores there are per 10,000 residents by county:

And the top 5 counties with the largest store to population ratio are:

## county_name state popstores ## 1: Sherman County OR 5.665722 ## 2: Culberson County TX 4.170142 ## 3: Trego County KS 3.332223 ## 4: Fredericksburg city VA 3.294079 ## 5: Williamsburg city VA 2.843332

In case youre now hungy for McDonalds, find the closest one(s) below: