

{"id":4217,"date":"2016-03-29T08:14:29","date_gmt":"2016-03-29T13:14:29","guid":{"rendered":"http:\/\/rud.is\/b\/?p=4217"},"modified":"2018-03-07T16:42:45","modified_gmt":"2018-03-07T21:42:45","slug":"easier-composite-u-s-choropleths-with-albersusa","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/","title":{"rendered":"Easier Composite U.S. Choropleths with albersusa"},"content":{"rendered":"<p>Folks who&#8217;ve been tracking this blog on R-bloggers probably remember [this post](https:\/\/rud.is\/b\/2014\/11\/16\/moving-the-earth-well-alaska-hawaii-with-r\/) where I showed how to create a composite U.S. map with an Albers projection (which is commonly referred to as AlbersUSA these days thanks to D3).<\/p>\n<p>I&#8217;m not sure why I didn&#8217;t think of this earlier, but you don&#8217;t _need_ to do those geographical machinations every time you want a prettier &#038; more inclusive map (Alaska &#038; Hawaii have been states for a while, so perhaps we should make more of an effort to include them in both data sets and maps). After doing the map transformations, the composite shape can be saved out to a shapefile, preferably GeoJSON since (a) you can use `geojsonio::geojson_write()` to save it and (b) it&#8217;s a single file vs a ZIP\/directory.<\/p>\n<p>I did just that and saved both state and country maps out with FIPS codes and other useful data slot bits and created a small data package : [`albersusa`](https:\/\/github.com\/hrbrmstr\/albersusa) : with some helper functions. It&#8217;s not in CRAN yet so you need to `devtools::install_github(&#8220;hrbrmstr\/albersusa&#8221;)` to use it. The github repo has some basic examples, heres a slightly more complex one.<\/p>\n<p>### Mapping Obesity<\/p>\n<p>I grabbed an [obesity data set](http:\/\/www.cdc.gov\/diabetes\/data\/county.html) from the CDC and put together a compact example for how to make a composite U.S. county choropleth to show obesity rates per county (for 2012, which is the most recent data). I read in the Excel file, pull out the county FIPS code and 2012 obesity rate, then build the choropleth. It&#8217;s not a whole lot of code, but that&#8217;s one main reason for the package!<\/p>\n<pre lang=\"rsplus\">library(readxl)\r\nlibrary(rgeos)\r\nlibrary(maptools)\r\nlibrary(ggplot2)   # devtools::install_github(\"hadley\/ggplot2\") only if you want subtitles\/captions\r\nlibrary(ggalt)\r\nlibrary(ggthemes)\r\nlibrary(albersusa) # devtools::install_github(\"hrbrmstr\/albersusa\")\r\nlibrary(viridis)\r\nlibrary(scales)\r\n\r\n# get the data and be nice to the server and keep a copy of the data for offline use\r\n\r\nURL <- \"http:\/\/www.cdc.gov\/diabetes\/atlas\/countydata\/OBPREV\/OB_PREV_ALL_STATES.xlsx\"\r\nfil <- basename(URL)\r\nif (!file.exists(fil)) download.file(URL, fil)\r\n\r\n# it's not a horrible Excel file, but we do need to hunt for the data\r\n# and clean it up a bit. we just need FIPS &#038; 2012 percent info\r\n\r\nwrkbk <- read_excel(fil)\r\nobesity_2012 <- setNames(wrkbk[-1, c(2, 61)], c(\"fips\", \"pct\"))\r\nobesity_2012$pct <- as.numeric(obesity_2012$pct) \/ 100\r\n\r\n# I may make a version of this that returns a fortified data.frame but\r\n# for now, we just need to read the built-in saved shapefile and turn it\r\n# into something ggplot2 can handle\r\n\r\ncmap <- fortify(counties_composite(), region=\"fips\")\r\n\r\n# and this is all it takes to make the map below\r\n\r\ngg <- ggplot()\r\ngg <- gg + geom_map(data=cmap, map=cmap,\r\n                    aes(x=long, y=lat, map_id=id),\r\n                    color=\"#2b2b2b\", size=0.05, fill=NA)\r\ngg <- gg + geom_map(data=obesity_2012, map=cmap,\r\n                    aes(fill=pct, map_id=fips),\r\n                    color=\"#2b2b2b\", size=0.05)\r\ngg <- gg + scale_fill_viridis(name=\"Obesity\", labels=percent)\r\ngg <- gg + coord_proj(us_laea_proj)\r\ngg <- gg + labs(title=\"U.S. Obesity Rate by County (2012)\",\r\n                subtitle=\"Content source: Centers for Disease Control and Prevention\",\r\n           caption=\"Data from http:\/\/www.cdc.gov\/diabetes\/atlas\/countydata\/County_ListofIndicators.html\")\r\ngg <- gg + theme_map(base_family=\"Arial Narrow\")\r\ngg <- gg + theme(legend.position=c(0.8, 0.25))\r\ngg <- gg + theme(plot.title=element_text(face=\"bold\", size=14, margin=margin(b=6)))\r\ngg <- gg + theme(plot.subtitle=element_text(size=10, margin=margin(b=-14)))\r\ngg<\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?ssl=1\" rel=\"attachment wp-att-4221\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4221\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/fullscreen_3_29_16__9_06_am\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&amp;ssl=1\" data-orig-size=\"1330,828\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Fullscreen_3_29_16__9_06_AM\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=510%2C318&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?resize=510%2C318&#038;ssl=1\" alt=\"Fullscreen_3_29_16__9_06_AM\" width=\"510\" height=\"318\" class=\"aligncenter size-full wp-image-4221\" \/><\/a><\/p>\n<p>### Fin<\/p>\n<p>Note that some cartographers think of this particular map view the way I look at a pie chart, but it's a compact & convenient way to keep the states\/counties together and will make it easier to include Alaska & Hawaii in your cartographic visualizations.<\/p>\n<p>The composite GeoJSON files are in:<\/p>\n<p>- `system.file(\"extdata\/composite_us_states.geojson.gz\", package=\"albersusa\")`<br \/>\n- `system.file(\"extdata\/composite_us_counties.geojson.gz\", package=\"albersusa\")`<\/p>\n<p>if you want to use them in another program\/context.<\/p>\n<p>Drop an issue [on github](https:\/\/github.com\/hrbrmstr\/albersusa) if you want any more default fields in the data slot and if you \"need\" territories (I'd rather have a PR for the latter tho :-).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Folks who&#8217;ve been tracking this blog on R-bloggers probably remember [this post](https:\/\/rud.is\/b\/2014\/11\/16\/moving-the-earth-well-alaska-hawaii-with-r\/) where I showed how to create a composite U.S. map with an Albers projection (which is commonly referred to as AlbersUSA these days thanks to D3). I&#8217;m not sure why I didn&#8217;t think of this earlier, but you don&#8217;t _need_ to do those [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4221,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[721,24,678,764,673,674,753,706,91],"tags":[810],"class_list":["post-4217","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cartography","category-charts-graphs","category-data-visualization","category-data-wrangling","category-datavis-2","category-dataviz","category-ggplot","category-maps","category-r","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Easier Composite U.S. Choropleths with albersusa - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Easier Composite U.S. Choropleths with albersusa - rud.is\" \/>\n<meta property=\"og:description\" content=\"Folks who&#8217;ve been tracking this blog on R-bloggers probably remember [this post](https:\/\/rud.is\/b\/2014\/11\/16\/moving-the-earth-well-alaska-hawaii-with-r\/) where I showed how to create a composite U.S. map with an Albers projection (which is commonly referred to as AlbersUSA these days thanks to D3). I&#8217;m not sure why I didn&#8217;t think of this earlier, but you don&#8217;t _need_ to do those [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-29T13:14:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:42:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1330\" \/>\n\t<meta property=\"og:image:height\" content=\"828\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Easier Composite U.S. Choropleths with albersusa\",\"datePublished\":\"2016-03-29T13:14:29+00:00\",\"dateModified\":\"2018-03-07T21:42:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/\"},\"wordCount\":420,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"cartography\",\"Charts &amp; Graphs\",\"Data Visualization\",\"data wrangling\",\"DataVis\",\"DataViz\",\"ggplot\",\"maps\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/\",\"name\":\"Easier Composite U.S. Choropleths with albersusa - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1\",\"datePublished\":\"2016-03-29T13:14:29+00:00\",\"dateModified\":\"2018-03-07T21:42:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1\",\"width\":1330,\"height\":828},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/29\\\/easier-composite-u-s-choropleths-with-albersusa\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Easier Composite U.S. Choropleths with albersusa\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Easier Composite U.S. Choropleths with albersusa - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/","og_locale":"en_US","og_type":"article","og_title":"Easier Composite U.S. Choropleths with albersusa - rud.is","og_description":"Folks who&#8217;ve been tracking this blog on R-bloggers probably remember [this post](https:\/\/rud.is\/b\/2014\/11\/16\/moving-the-earth-well-alaska-hawaii-with-r\/) where I showed how to create a composite U.S. map with an Albers projection (which is commonly referred to as AlbersUSA these days thanks to D3). I&#8217;m not sure why I didn&#8217;t think of this earlier, but you don&#8217;t _need_ to do those [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/","og_site_name":"rud.is","article_published_time":"2016-03-29T13:14:29+00:00","article_modified_time":"2018-03-07T21:42:45+00:00","og_image":[{"width":1330,"height":828,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Easier Composite U.S. Choropleths with albersusa","datePublished":"2016-03-29T13:14:29+00:00","dateModified":"2018-03-07T21:42:45+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/"},"wordCount":420,"commentCount":3,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1","keywords":["post"],"articleSection":["cartography","Charts &amp; Graphs","Data Visualization","data wrangling","DataVis","DataViz","ggplot","maps","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/","url":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/","name":"Easier Composite U.S. Choropleths with albersusa - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1","datePublished":"2016-03-29T13:14:29+00:00","dateModified":"2018-03-07T21:42:45+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1","width":1330,"height":828},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Easier Composite U.S. Choropleths with albersusa"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1330%2C828&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-161","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3117,"url":"https:\/\/rud.is\/b\/2014\/11\/16\/moving-the-earth-well-alaska-hawaii-with-r\/","url_meta":{"origin":4217,"position":0},"title":"Moving The Earth (well, Alaska &#038; Hawaii) With R","author":"hrbrmstr","date":"2014-11-16","format":false,"excerpt":"In a previous post we looked at how to use D3 TopoJSON files with R and make some very D3-esque maps. I mentioned that one thing missing was moving Alaska & Hawaii a bit closer to the continental United States and this post shows you how to do that. The\u2026","rel":"","context":"In &quot;d3&quot;","block_context":{"text":"d3","link":"https:\/\/rud.is\/b\/category\/d3\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11840,"url":"https:\/\/rud.is\/b\/2019\/01\/30\/fast-static-maps-built-with-r\/","url_meta":{"origin":4217,"position":1},"title":"Fast Static Maps Built with R","author":"hrbrmstr","date":"2019-01-30","format":false,"excerpt":"Luke Whyte posted an article (apologies for a Medium link) over on Towards Data Science showing how to use a command line workflow involving curl, node and various D3 libraries and javascript source files to build a series of SVG static maps. It's well written and you should give it\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/fast-static-maps.png?fit=1200%2C806&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/fast-static-maps.png?fit=1200%2C806&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/fast-static-maps.png?fit=1200%2C806&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/fast-static-maps.png?fit=1200%2C806&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/fast-static-maps.png?fit=1200%2C806&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3158,"url":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","url_meta":{"origin":4217,"position":2},"title":"Making Static &#038; Interactive Maps With ggvis (+ using ggvis maps w\/shiny)","author":"hrbrmstr","date":"2014-12-29","format":false,"excerpt":"Even though it's still at version `0.4`, the `ggvis` package has quite a bit of functionality and is highly useful for exploratory data analysis (EDA). I wanted to see how geographical visualizations would work under it, so I put together six examples that show how to use various features of\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3413,"url":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/","url_meta":{"origin":4217,"position":3},"title":"U.S. Drought Monitoring With Hexbin State Maps in R","author":"hrbrmstr","date":"2015-05-15","format":false,"excerpt":"On the news, today, of the early stages of drought hitting the U.S. northeast states I decided to springboard off of yesterday's post and show a more practical use of hexbin state maps than the built-in (and still purpose unknown to me) \"bees\" data. The U.S. Drought Monitor site supplies\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14337,"url":"https:\/\/rud.is\/b\/2023\/09\/09\/foliage-2023\/","url_meta":{"origin":4217,"position":4},"title":"Foliage 2023","author":"hrbrmstr","date":"2023-09-09","format":false,"excerpt":"2023-09-10 UPDATE: Art Steinmetz took me up on the Shiny challenge (at the end of the post) and did a fantastic job! The days are getting shorter and when we were visiting Down East Maine the other week, there was just a hint of some trees starting to change up\u2026","rel":"","context":"In &quot;data wrangling&quot;","block_context":{"text":"data wrangling","link":"https:\/\/rud.is\/b\/category\/data-wrangling\/"},"img":{"alt_text":"conus foliage map 2023","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/09\/lit-plot.png?fit=1200%2C1137&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/09\/lit-plot.png?fit=1200%2C1137&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/09\/lit-plot.png?fit=1200%2C1137&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/09\/lit-plot.png?fit=1200%2C1137&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/09\/lit-plot.png?fit=1200%2C1137&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3054,"url":"https:\/\/rud.is\/b\/2014\/09\/26\/overcoming-d3-cartographic-envy-with-r-ggplot\/","url_meta":{"origin":4217,"position":5},"title":"Overcoming D3 Cartographic Envy With R + ggplot","author":"hrbrmstr","date":"2014-09-26","format":false,"excerpt":"When I used one of the Scotland TopoJSON files for a recent post, it really hit me just how much D3 cartography envy I had\/have as an R user. Don't get me wrong, I can conjure up D3 maps pretty well [1] [2] and the utility of an interactive map\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=4217"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4217\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/4221"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=4217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=4217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=4217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}