

{"id":3413,"date":"2015-05-15T07:18:28","date_gmt":"2015-05-15T12:18:28","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3413"},"modified":"2018-07-09T06:55:08","modified_gmt":"2018-07-09T11:55:08","slug":"u-s-drought-monitoring-with-hexbin-state-maps-in-r","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/","title":{"rendered":"U.S. Drought Monitoring With Hexbin State Maps in R"},"content":{"rendered":"<p>On the news, today, of the <a href=\"\">early stages of drought hitting the U.S. northeast states<\/a> I decided to springboard off of <a href=\"https:\/\/rud.is\/b\/2015\/05\/14\/geojson-hexagonal-statebins-in-r\/\">yesterday&#8217;s post<\/a> and show a more practical use of hexbin state maps than the built-in (and still purpose unknown to me) &#8220;bees&#8221; data.<\/p>\n<p>The <a href=\"http:\/\/droughtmonitor.unl.edu\/MapsAndData\/GISData.aspx\">U.S. Drought Monitor site<\/a> supplies more than just a pretty county-level map. There&#8217;s plenty of <a href=\"http:\/\/droughtmonitor.unl.edu\/MapsAndData\/GISData.aspx\">data<\/a> and you can dynamically retrieve just data tables for the whole U.S., U.S. states and U.S. counties. Since we&#8217;re working with state hexbins, we just need the state-level data. Drought levels for all five stages are reported per-state, so we can take all this data and created a faceted\/small-multiples map based on it.<\/p>\n<p>This builds quite a bit on the previous work, so you&#8217;ll see some familiar code. Most of the new code is actually making the map look nice (the great part about this is that once you have the idiom down, it&#8217;s just a matter of running the script each day vs a billion mouse clicks). The other bit of new code is the data-retrieval component:<\/p>\n<pre><code class=\"language-r\">library(readr)\nlibrary(tidyr)\nlibrary(dplyr)\n\nintensity <- c(D0=\"Abnormally Dry\", D1=\"Moderate Drought\", D2=\"Severe Drought\", \n               D3=\"Extreme Drought\", D4=\"Exceptional Drought\")\n\ntoday <- format(Sys.Date(), \"%Y%m%d\")\n\nread_csv(sprintf(\"http:\/\/droughtmonitor.unl.edu\/USDMStatistics.ashx\/?mode=table&#038;aoi=state&#038;date=%s\", today)) %>% \n  gather(drought_level, value, D0, D1, D2, D3, D4) %>% \n  mutate(intensity=factor(intensity[drought_level], \n                          levels=as.character(intensity), ordered=TRUE)) -> drought<\/code><\/pre>\n<p>This:<\/p>\n<ul>\n<li>sets up a fast way to add the prettier description of the drought levels (besides D0, D1, etc)<\/li>\n<li>dynamically uses today&#8217;s date as the parameter for the URL we read with <code>read_csv<\/code> (from the <code>readr<\/code> package)<\/li>\n<li>covert the data from wide to long<\/li>\n<li>adds the intensity description<\/li>\n<\/ul>\n<p>The <code>ggplot<\/code> code will facet on the intensity level to make the overall map:<\/p>\n<pre><code class=\"language-r\">library(rgdal)\nlibrary(rgeos)\nlibrary(ggplot2)\nlibrary(readr)\nlibrary(tidyr)\nlibrary(dplyr)\nlibrary(grid)\n\n# get map from https:\/\/gist.github.com\/hrbrmstr\/51f961198f65509ad863#file-us_states_hexgrid-geojson\n\nus <- readOGR(\"us_states_hexgrid.geojson\", \"OGRGeoJSON\")\n\ncenters <- cbind.data.frame(data.frame(gCentroid(us, byid=TRUE), id=us@data$iso3166_2))\n\nus_map <- fortify(us, region=\"iso3166_2\")\n\nintensity <- c(D0=\"Abnormally Dry\", D1=\"Moderate Drought\", D2=\"Severe Drought\",\n               D3=\"Extreme Drought\", D4=\"Exceptional Drought\")\n\ntoday <- format(Sys.Date(), \"%Y%m%d\")\n\nread_csv(sprintf(\"http:\/\/droughtmonitor.unl.edu\/USDMStatistics.ashx\/?mode=table&#038;aoi=state&#038;date=%s\", today)) %>%\n  gather(drought_level, value, D0, D1, D2, D3, D4) %>%\n  mutate(intensity=factor(intensity[drought_level],\n                          levels=as.character(intensity), ordered=TRUE)) -> drought\n\ngg <- ggplot()\ngg <- gg + geom_map(data=us_map, map=us_map,\n                    aes(x=long, y=lat, map_id=id),\n                    color=\"white\", size=0.5)\ngg <- gg + geom_map(data=drought, map=us_map,\n                    aes(fill=value, map_id=State))\ngg <- gg + geom_map(data=drought, map=us_map,\n                    aes(map_id=State),\n                    fill=\"#ffffff\", alpha=0, color=\"white\",\n                    show_guide=FALSE)\ngg <- gg + geom_text(data=centers, aes(label=id, x=x, y=y), color=\"white\", size=4)\ngg <- gg + scale_fill_distiller(name=\"State\\nDrought\\nCoverage\", palette=\"RdPu\", na.value=\"#7f7f7f\",\n                                labels=sprintf(\"%d%%\", c(0, 25, 50, 75, 100)))\ngg <- gg + coord_map()\ngg <- gg + facet_wrap(~intensity, ncol=2)\ngg <- gg + labs(x=NULL, y=NULL, title=sprintf(\"U.S. Drought Conditions as of %s\\n\", Sys.Date()))\ngg <- gg + theme_bw()\ngg <- gg + theme(plot.title=element_text(face=\"bold\", hjust=0, size=24))\ngg <- gg + theme(panel.border=element_blank())\ngg <- gg + theme(panel.margin=unit(3, \"lines\"))\ngg <- gg + theme(panel.grid=element_blank())\ngg <- gg + theme(axis.ticks=element_blank())\ngg <- gg + theme(axis.text=element_blank())\ngg <- gg + theme(strip.background=element_blank())\ngg <- gg + theme(strip.text=element_text(face=\"bold\", hjust=0, size=14))\ngg <- gg + theme(legend.position=c(0.75, 0.15))\ngg <- gg + theme(legend.direction=\"horizontal\")\ngg <- gg + theme(legend.title.align=1)\n\npng(sprintf(\"%s.png\", today), width=800, height=800)\nprint(gg)\ndev.off()<\/code><\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3416\" data-permalink=\"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/20150515-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png?fit=800%2C800&amp;ssl=1\" data-orig-size=\"800,800\" 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=\"20150515\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png?fit=510%2C510&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png?resize=510%2C510&#038;ssl=1\" alt=\"20150515\" width=\"510\" height=\"510\" class=\"aligncenter size-full wp-image-3416\" \/><\/p>\n<p>Now, you can easily animate these over time to show the progression\/regression of the drought conditions. If you're sure your audience can work with SVG files, you can use those for very crisp\/sharp maps (and even feed it to D3 or path editing tools). If you have an example of how you're using hexbin choropleths, drop a note in the comments. The code from above is also <a href=\"https:\/\/gist.github.com\/hrbrmstr\/51f961198f65509ad863\">on github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On the news, today, of the early stages of drought hitting the U.S. northeast states I decided to springboard off of yesterday&#8217;s post and show a more practical use of hexbin state maps than the built-in (and still purpose unknown to me) &#8220;bees&#8221; data. The U.S. Drought Monitor site supplies more than just a pretty [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"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,678,673,674,706,91],"tags":[810],"class_list":["post-3413","post","type-post","status-publish","format-standard","hentry","category-cartography","category-data-visualization","category-datavis-2","category-dataviz","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>U.S. Drought Monitoring With Hexbin State Maps in R - 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\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"U.S. Drought Monitoring With Hexbin State Maps in R - rud.is\" \/>\n<meta property=\"og:description\" content=\"On the news, today, of the early stages of drought hitting the U.S. northeast states I decided to springboard off of yesterday&#8217;s post and show a more practical use of hexbin state maps than the built-in (and still purpose unknown to me) &#8220;bees&#8221; data. The U.S. Drought Monitor site supplies more than just a pretty [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-15T12:18:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-09T11:55:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"U.S. Drought Monitoring With Hexbin State Maps in R\",\"datePublished\":\"2015-05-15T12:18:28+00:00\",\"dateModified\":\"2018-07-09T11:55:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/\"},\"wordCount\":333,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/201505151.png\",\"keywords\":[\"post\"],\"articleSection\":[\"cartography\",\"Data Visualization\",\"DataVis\",\"DataViz\",\"maps\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/\",\"name\":\"U.S. Drought Monitoring With Hexbin State Maps in R - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/201505151.png\",\"datePublished\":\"2015-05-15T12:18:28+00:00\",\"dateModified\":\"2018-07-09T11:55:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/201505151.png?fit=800%2C800&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/201505151.png?fit=800%2C800&ssl=1\",\"width\":800,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/05\\\/15\\\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"U.S. Drought Monitoring With Hexbin State Maps in R\"}]},{\"@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":"U.S. Drought Monitoring With Hexbin State Maps in R - 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\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/","og_locale":"en_US","og_type":"article","og_title":"U.S. Drought Monitoring With Hexbin State Maps in R - rud.is","og_description":"On the news, today, of the early stages of drought hitting the U.S. northeast states I decided to springboard off of yesterday&#8217;s post and show a more practical use of hexbin state maps than the built-in (and still purpose unknown to me) &#8220;bees&#8221; data. The U.S. Drought Monitor site supplies more than just a pretty [&hellip;]","og_url":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/","og_site_name":"rud.is","article_published_time":"2015-05-15T12:18:28+00:00","article_modified_time":"2018-07-09T11:55:08+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"U.S. Drought Monitoring With Hexbin State Maps in R","datePublished":"2015-05-15T12:18:28+00:00","dateModified":"2018-07-09T11:55:08+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/"},"wordCount":333,"commentCount":0,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png","keywords":["post"],"articleSection":["cartography","Data Visualization","DataVis","DataViz","maps","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/","url":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/","name":"U.S. Drought Monitoring With Hexbin State Maps in R - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png","datePublished":"2015-05-15T12:18:28+00:00","dateModified":"2018-07-09T11:55:08+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png?fit=800%2C800&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/05\/201505151.png?fit=800%2C800&ssl=1","width":800,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2015\/05\/15\/u-s-drought-monitoring-with-hexbin-state-maps-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"U.S. Drought Monitoring With Hexbin State Maps in R"}]},{"@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":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-T3","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":3413,"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":4574,"url":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/","url_meta":{"origin":3413,"position":1},"title":"U.S. Drought Animations with the &#8220;Witch&#8217;s Brew&#8221; (purrr + broom + magick)","author":"hrbrmstr","date":"2016-07-27","format":false,"excerpt":"This is another purrr-focused post but it's also an homage to the nascent magick package (R interface to ImageMagick) by @opencpu. We're starting to see\/feel the impact of the increasing drought up here in southern Maine. I've used the data from the U.S. Drought Monitor before on the blog, but\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":4217,"url":"https:\/\/rud.is\/b\/2016\/03\/29\/easier-composite-u-s-choropleths-with-albersusa\/","url_meta":{"origin":3413,"position":2},"title":"Easier Composite U.S. Choropleths with albersusa","author":"hrbrmstr","date":"2016-03-29","format":false,"excerpt":"Folks who'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'm not sure why I didn't think of this earlier, but you\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1200%2C747&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1200%2C747&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1200%2C747&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1200%2C747&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_29_16__9_06_AM.png?fit=1200%2C747&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3455,"url":"https:\/\/rud.is\/b\/2015\/06\/07\/animated-us-hexbin-map-of-the-avian-flu-outbreak\/","url_meta":{"origin":3413,"position":3},"title":"Animated US Hexbin Map of the Avian Flu Outbreak","author":"hrbrmstr","date":"2015-06-07","format":false,"excerpt":"The recent announcement of the [start of egg rationing in the U.S.](http:\/\/www.washingtonpost.com\/blogs\/wonkblog\/wp\/2015\/06\/05\/the-largest-grocer-in-the-texas-is-now-rationing-eggs\/) made me curious enough about the avian flu outbreak to try to dig into the numbers a bit. I finally stumbled upon a [USDA site](http:\/\/www.aphis.usda.gov\/wps\/portal\/aphis\/ourfocus\/animalhealth\/sa_animal_disease_information\/sa_avian_health\/sa_detections_by_states\/ct_ai_pacific_flyway\/!ut\/p\/a1\/lVPBkqIwEP2WOexpCxMBAY-oo6Kybo01q3JJNSGB1GCgSNTi7zcwe3CnZnQ3h1Sl-3X369cdlKADSiRcRA5aVBLK7p14ZLVd2sMJtqPFbvyMox-_5nGw8Z3t0jWAowHgL06I_47friOvi3_Bk-VsiHcO2qMEJVTqWhfoCHUhFKGV1ExqUoq0gab9hhWQ6twQXtGz6l8gxQlKUjAodXFryYRioBgRklfNqW_i3X0RIG_xGdOMdm5F0pYoDZqZ1FQTEKQGKrighJftFdqOX01Fho7c9iiAzS3HG6WWm2HbSnmAzYXxyA3AG1L-R487Df-TntNFuHT9jVHQDWwczUywP44xjrxH8b2eDzL0gHsj-1Bk8TwxReabn_56ZeP1CB0NSf9LFmMX7f5TtdXDtmYoib9z5YadQnYTT-PcVABdWN2s0eHuDry7b3agN3y2A-jw6Q4YfnlZpeZD7Ke3REKZOoEh0jDOGtYMikppdLher4OzymCQVxdUn15PgdMK6-0lwM7obR9ayTx_evoNPxBrVg!!\/?1dmy&urile=wcm:path:\/APHIS_Content_Library\/SA_Our_Focus\/SA_Animal_Health\/SA_Animal_Disease_Information\/SA_Avian_Health\/SA_Detections_by_States\/) that had an embedded HTML table of flock outbreak statistics by state, county\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":3158,"url":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","url_meta":{"origin":3413,"position":4},"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":11840,"url":"https:\/\/rud.is\/b\/2019\/01\/30\/fast-static-maps-built-with-r\/","url_meta":{"origin":3413,"position":5},"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":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3413","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=3413"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3413\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}