Last active
August 29, 2015 13:56
-
-
Save ramhiser/8834016 to your computer and use it in GitHub Desktop.
Creates data.frame of census regions by state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For info about census regions, see: | |
# http://en.wikipedia.org/wiki/List_of_regions_of_the_United_States#Census_Bureau-designated_regions_and_divisions | |
# Region - Northeast | |
# Division - New England | |
new_england <- data.frame( | |
region = "Northeast", | |
division = "New England", | |
state = c("ME", "NH", "VT", "MA", "RI", "CT") | |
) | |
# Division - Mid-Atlantic | |
mid_atlantic <- data.frame( | |
region = "Northeast", | |
division = "Mid-Atlantic", | |
state = c("NY", "PA", "NJ") | |
) | |
# Region - Midwest | |
# Division - East North Central | |
east_north_central <- data.frame( | |
region = "Midwest", | |
division = "East North Central", | |
state = c("WI", "MI", "IL", "IN", "OH") | |
) | |
# Division - West North Central | |
west_north_central <- data.frame( | |
region = "Midwest", | |
division = "West North Central", | |
state = c("MO", "ND", "SD", "NE", "KS", "MN", "IA") | |
) | |
# Region - South | |
# Division - South Atlantic | |
south_atlantic <- data.frame( | |
region = "South", | |
division = "South Atlantic", | |
state = c("DE", "MD", "DC", "VA", "WV", "NC", "SC", "GA", "FL") | |
) | |
# Division - East South Central | |
east_south_central <- data.frame( | |
region = "South", | |
division = "East South Central", | |
state = c("KY", "TN", "MS", "AL") | |
) | |
# Division - West South Central | |
west_south_central <- data.frame( | |
region = "South", | |
division = "West South Central", | |
state = c("OK", "TX", "AR", "LA") | |
) | |
# Region - West | |
# Division - Mountain | |
mountain <- data.frame( | |
region = "West", | |
division = "Mountain", | |
state = c("ID", "MT", "WY", "NV", "UT", "CO", "AZ", "NM") | |
) | |
# Division - Pacific | |
pacific <- data.frame( | |
region = "West", | |
division = "Pacific", | |
state = c("AK", "WA", "OR", "CA", "HI") | |
) | |
census_regions <- rbind(new_england, | |
mid_atlantic, | |
east_north_central, | |
west_north_central, | |
south_atlantic, | |
east_south_central, | |
west_south_central, | |
mountain, | |
pacific | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment