I have lived in New York City and Boston, and have visited some other cities. In those cities, I have noticed one thing, it seems that Chinatown is always close to the financial district.
Therefore, I want to do some simple analysis to see if that’s always the case.
List of Cities
I searched online and found this list: 10 best Chinatowns across the USA.
Then what I did was just some very very simple web scraping to get the city names and make them into a data frame.
Now I need to find where Chinatowns and the Financial Districts are located in those cities.
Note: The reason I removed Honolulu is that I only want to consider the Contiguous United States.
List of Zip Codes
Here I did some manual look-up to find the zip codes of Chinatowns and Financial Districts and add them to the city data frame.
This is not ideal, as at first I was trying to programmatically find the polygon coordinates of those two areas, however, it seems that Google Maps API doesn’t support that, though Google apparently has that data:(.
Then I tried to use
geocode function from
ggmap package to get the zip codes:
However, the problem here is that in certain cities, Chinatown and/or Financial District are not well-defined, and thus the above function would return some empty results. Compromisingly, I had to do some research and find the zip codes. I tried to pick the zip code that’s in the center of the area.
To get the distances, I used the
mapdist function from
From the above, we could see that the distances are mostly within 3 miles, and usually within 30 minutes walk. The reason I chose to use walking mode when measure distance is because walking is usually more flexible and traffic-free.
Draw on Maps
At last, I also made some visualizations to show Chinatown and Financial Districts on city maps. I used the
zipcode dataset from the
zipcode package to get the longitude and latitude of those zip codes so that I could plot them on map.
Next, I created a function to map them on maps without having to write the similar code again and again.
1. Seattle, WA
2. San Francisco, CA
3. Boston, MA
4. Los Angeles, CA
5. Philadelphia, PA
6. New York City, NY
7. Washington, DC
8. Chicago, IL
9. Houston, TX
Objectively speaking, I am a little bit disappointed because they are not as close as I thought they would be, and especially in Houston, they are really far away from each other.
Subjectively speaking, there are some issues with this analysis:
I wasn’t able to get border coordinates of the two areas in all the cities
In some cities, Financial Districts are not well-defined
Sample size is small as there is still a lot of other major cities
The zoom settings are different in different cities when ploting points on map because the areas of those cities are different
Closesness is somewhat vague and objective, here I used the absolute distance, but I could also use relative distance, taking city size into account
The good thing is that this analysis gives me a chance to test my initial hypothesis, it doesn’t matter if the result supports your hypothesis/theory or not, data analysis is always fun.
Share onTwitter Facebook Google+ LinkedIn WeChat Weibo
Leave a Comment
Your email address will not be published. Required fields are marked *