{"id":1031,"date":"2012-12-21T19:08:59","date_gmt":"2012-12-21T19:08:59","guid":{"rendered":"https:\/\/blogs.swarthmore.edu\/institutional-research\/?p=1031"},"modified":"2023-09-13T15:41:14","modified_gmt":"2023-09-13T15:41:14","slug":"fast-zip-code-map","status":"publish","type":"post","link":"https:\/\/blogs.swarthmore.edu\/institutional-research\/?p=1031","title":{"rendered":"Fast zip code map"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.swarthmore.edu\/institutional-research\/wp-content\/uploads\/2012\/12\/ggmap-zips2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1052\" title=\"Student Zip Code Map\" src=\"https:\/\/blogs.swarthmore.edu\/institutional-research\/wp-content\/uploads\/2012\/12\/ggmap-zips2.png\" alt=\"\" width=\"1920\" height=\"963\" srcset=\"https:\/\/blogs.swarthmore.edu\/institutional-research\/wp-content\/uploads\/2012\/12\/ggmap-zips2.png 1920w, https:\/\/blogs.swarthmore.edu\/institutional-research\/wp-content\/uploads\/2012\/12\/ggmap-zips2-300x150.png 300w, https:\/\/blogs.swarthmore.edu\/institutional-research\/wp-content\/uploads\/2012\/12\/ggmap-zips2-1024x513.png 1024w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">[click to enlarge]<\/p>\n<p>I&#8217;ve recently been playing around with the <a href=\"http:\/\/cran.r-project.org\/web\/packages\/ggmap\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">ggmap package<\/a> in R and was able to quickly put together a bubble chart version of student home zip codes. \u00a0As you can see from the two legends, the size and color both reflect the number of students in these zip codes.<\/p>\n<p>I will certainly be playing around with ggmaps so more as this map required only two lines of code (after the ggmap library was loaded).<\/p>\n<p><span style=\"text-decoration: underline;\">R CODE<\/span>:<\/p>\n<p><span style=\"color: #000000;\">usmap&lt;-qmap(&#8216;united states&#8217;, zoom=4, source=&#8217;osm&#8217;,extent=&#8217;panel&#8217;)<\/span><\/p>\n<p><span style=\"color: #000000;\">usmap+geom_point(aes(x=X, y=Y, size=COUNT, color=COUNT), data=DATA, alpha=.5)<\/span><\/p>\n<p><span style=\"color: #ff0000;\">HAPPY HOLIDAYS!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[click to enlarge] I&#8217;ve recently been playing around with the ggmap package in R and was able to quickly put together a bubble chart version of student home zip codes. \u00a0As you can see from the two legends, the size and color both reflect the number of students in these zip codes. I will certainly &hellip; <a href=\"https:\/\/blogs.swarthmore.edu\/institutional-research\/?p=1031\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Fast zip code map<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=\/wp\/v2\/posts\/1031"}],"collection":[{"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1031"}],"version-history":[{"count":23,"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":1554,"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions\/1554"}],"wp:attachment":[{"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/institutional-research\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}