Eat globally, locally; how many country’s foods can be eaten in Chicagoland ?

Ah, the times we live in.
I was having discussion with friends about food and it turned to the question about how many countries are represented locally in Chicago by restaurants. There was a time in the not so distant past when such a question would be settled like many bar sports bets; stake out an early guess pulled out of thin air, tenaciously cling to it for years as information trickled in and the question was forgotten, then guess again when it was brought up again.
But no longer….I think we can come up with a reasonable estimate these days.

The first step involved was coming up with a master list of countries. I figured a reasonable place for this was the United nations website, so I grabbed a list from the website here.
I used a Python script and BeautifulSoup package to scrape the list of 194 countries.

Now came the most manual portion of the exercise. Using the above spreadsheet, my knowledge of local restaurants and Google (especially for LTHforum.com and Yelp), I attempted to find any countries on the list which was represented by a restaurant in Chicagoland. I have no delusions that this is comprehensive; it was as good as I could do, but I’m sure I missed some restaurants along the way. So caveat emptor if you can’t find a matching restaurant listed here (and don’t forget what the emptor is paying for this info ).

In the final count, I came with 80 countries that had associated restaurants in Chicagoland.
Well, it’s nice to have a sketchy spreadsheet and an associated count, but I think seeing our global coverage might be more be more interesting. To do so, I used the GIS capabilities of R. The first step was to find a shapefile for the countries of the world.
The one found here looked like it would do the trick.

The first thing I noticed was there were more than my 194 countries from the UN on the shapefile data. A little investigation showed that these were mostly territories. I was OK excluding these from the analysis (they will get washed out as areas not having restaurants).

The following R script was used for the GIS portion of analysis

library(rgdal,rgeos)

#Import restaurants
restaurants<-read.csv(“restbycntry_csv.csv”,header=FALSE)

#Import shapefile of countries
world_gis<-readOGR(dsn=”data”,layer=”world_country_admin_boundary_shapefile_with_fips_codes”)

# Merge restaurants and world_gis
world_gis@data<-merge(world_gis@data,restaurants,by.x=”FIPS_CNTRY”,by.y=”V1″,all.x=TRUE)

#Now we want a new column on world_gis@data….it should indicate whether V3 has text in it (ie not NA or NONE or blank)
# NA mean territories on shapefile that are not on restaurant file
# NONE means restaurants on my file that I’m pretty sure dont exist
# Blank means I haven’t found one yet but may exist….for now, that’s the same as NONE above

world_gis@data$restexist<-ifelse((world_gis@data$V3==””)|is.na(world_gis@data$V3)|(world_gis@data$V3==”NONE”),0,1)

# NOW plot

plot(world_gis)
crit<-world_gis$restexist == 1
plot(world_gis[ crit , ], col = “blue”, add = TRUE)

This produced the following graphic; countries marked in blue are represented by a restaurant in Chicagoland.

 

world_eats_robinson1_crop

 

0 comments on “Eat globally, locally; how many country’s foods can be eaten in Chicagoland ?
1 Pings/Trackbacks for "Eat globally, locally; how many country’s foods can be eaten in Chicagoland ?"
  1. […] while back, I had undertaken a little project to determine how many country’s┬árestaurants were represented in the Chicagoland area. This […]