

{"id":4574,"date":"2016-07-27T09:08:54","date_gmt":"2016-07-27T14:08:54","guid":{"rendered":"https:\/\/rud.is\/b\/?p=4574"},"modified":"2018-07-09T06:26:21","modified_gmt":"2018-07-09T11:26:21","slug":"u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/","title":{"rendered":"U.S. Drought Animations with the &#8220;Witch&#8217;s Brew&#8221; (purrr + broom + magick)"},"content":{"rendered":"<p>This is another <code>purrr<\/code>-focused post but it&#8217;s also an homage to the nascent <code>magick<\/code> package (R interface to ImageMagick) by @opencpu.<\/p>\n<p>We&#8217;re starting to see\/feel the impact of the increasing drought up here in southern Maine. I&#8217;ve used the data from the <a href=\"http:\/\/droughtmonitor.unl.edu\/MapsAndData\/GISData.aspx\">U.S. Drought Monitor<\/a> before on the blog, but they also provide shapefiles and this seemed like a good opportunity to further demonstrate the utility of <code>purrr<\/code> and make animations directly using <code>magick<\/code>. Plus, I wanted to see the progression of the drought. Putting <code>library()<\/code> statements for <code>purrr<\/code>, <code>magick<\/code> and <code>broom<\/code> together was completely random, but I now feel compelled to find a set of functions to put into a <code>cauldron<\/code> package. But, I digress.<\/p>\n<h3>What does this demonstrate?<\/h3>\n<p>Apart from giving you an idea of the extent of the drought, working through this will help you:<\/p>\n<ul>\n<li>use the <code>quietly()<\/code> function (which automagically turns off warnings for a function)<\/li>\n<li>see another example of a formula function<\/li>\n<li>illustrate the utility <code>map_df()<\/code>, and<\/li>\n<li>see how to create an animation pipeline for <code>magick<\/code><\/li>\n<\/ul>\n<p>Comments are in the code and the drought gif is at the end. I deliberately only had it loop once, so refresh the image if you want to see the progression again. Also, drop a note in the comments if anything needs more exposition. (NOTE: I was fairly bad and did virtually no file cleanup in the function, so you&#8217;ll have half a year&#8217;s shapefiles in your <code>getwd()<\/code>. Consider the cleanup an exercise for the reader :-)<\/p>\n<pre id=\"drought-2016-01\"><code class=\"language-r\">library(rgdal)\r\nlibrary(sp)\r\nlibrary(albersusa) # devtools::install_github(&quot;hrbrmstr\/albersusa&quot;)\r\nlibrary(ggplot2) # devtools::install_github(&quot;hadley\/ggplot2&quot;)\r\nlibrary(ggthemes)\r\nlibrary(rgeos)\r\n\r\n# the witch&#039;s brew\r\nlibrary(purrr)\r\nlibrary(broom)\r\nlibrary(magick)\r\n\r\n#&#039; Get a drought map shapefile and turn it into a PNG\r\ndrought_map &lt;- function(wk) {\r\n\r\n  # need to hush some chatty functions\r\n  hush_tidy &lt;- quietly(tidy)\r\n\r\n  # some are more stubbon than others\r\n  old_warn &lt;- getOption(&quot;warn&quot;)\r\n  options(warn=-1)\r\n\r\n  week &lt;- format(wk, &quot;%Y%m%d&quot;)\r\n\r\n  # get the drought shapefile only if we don&#039;t have it already\r\n  URL &lt;- sprintf(&quot;http:\/\/droughtmonitor.unl.edu\/data\/shapefiles_m\/USDM_%s_M.zip&quot;, week)\r\n  (fil &lt;- basename(URL))\r\n  if (!file.exists(fil)) download.file(URL, fil)\r\n  unzip(fil)\r\n\r\n  # read in the shapefile and reduce the polygon complexity\r\n  dr &lt;- readOGR(sprintf(&quot;USDM_%s.shp&quot;, week),\r\n                sprintf(&quot;USDM_%s&quot;, week),\r\n                verbose=FALSE,\r\n                stringsAsFactors=FALSE)\r\n\r\n  dr &lt;- SpatialPolygonsDataFrame(gSimplify(dr, 0.01, TRUE), dr@data)\r\n\r\n  # turn separate out each drought level into its own fortified data.frame\r\n  map(dr$DM, ~subset(dr, DM==.)) %&gt;%\r\n    map(hush_tidy) %&gt;%\r\n    map_df(&quot;result&quot;, .id=&quot;DM&quot;) -&gt; m\r\n\r\n  # get a conus base map (prbly cld have done map_data(&quot;usa&quot;), too)\r\n  usa_composite() %&gt;%\r\n    subset(!(iso_3166_2 %in% c(&quot;AK&quot;, &quot;HI&quot;))) %&gt;%\r\n    hush_tidy() -&gt; usa\r\n\r\n  usa &lt;- usa$result # an artifact of using quietly()\r\n\r\n  # this is all Ushey&#039;s fault. the utility of cmd-enter to run\r\n  # the entire ggplot2 chain (in RStudio) turns out to have a\r\n  # greater productity boost (i measured it) than my shortcuts for\r\n  # gg &lt;- gg + snippets and hand-editing the &quot;+&quot; bits out when\r\n  # editing old plot constructs. I&#039;m not giving up on gg &lt;- gg + tho\r\n\r\n  # Note putting the &quot;base&quot; layer on top since we don&#039;t really\r\n  # want to deal with alpha levels of the drought polygons and\r\n  # we&#039;re only plotting the outline of the us\/states, not filling\r\n  # the interior(s).\r\n\r\n  ggplot() +\r\n    geom_map(data=m, map=m,\r\n             aes(long, lat, fill=DM, map_id=id),\r\n             color=&quot;#2b2b2b&quot;, size=0.05) +\r\n    geom_map(data=usa, map=usa, aes(long, lat, map_id=id),\r\n             color=&quot;#2b2b2b88&quot;, fill=NA, size=0.1) +\r\n    scale_fill_brewer(&quot;Drought Level&quot;, palette=&quot;YlOrBr&quot;) +\r\n    coord_map(&quot;polyconic&quot;, xlim=c(-130, -65), ylim=c(25, 50)) +\r\n    labs(x=sprintf(&quot;Week: %s&quot;, wk)) +\r\n    theme_map() +\r\n    theme(axis.title=element_text()) +\r\n    theme(axis.title.x=element_text()) +\r\n    theme(axis.title.y=element_blank()) +\r\n    theme(legend.position=&quot;bottom&quot;) +\r\n    theme(legend.direction=&quot;horizontal&quot;) -&gt; gg\r\n\r\n  options(warn=old_warn) # put things back the way they were\r\n\r\n  outfil &lt;- sprintf(&quot;gg-dm-%s.png&quot;, wk)\r\n  ggsave(outfil, gg, width=8, height=5)\r\n\r\n  outfil\r\n\r\n}\r\n\r\n# - create a vector of weeks (minus the current one)\r\n# - create the individual map PNGs\r\n# - read the individual map PNGs into a list\r\n# - join the images together\r\n# - create the animated gif structure\r\n# - write the gif to a file\r\n\r\nseq(as.Date(&quot;2016-01-05&quot;), Sys.Date(), by=&quot;1 week&quot;) %&gt;%\r\n  head(-1) %&gt;%\r\n  map(drought_map) %&gt;%\r\n  map(image_read) %&gt;%\r\n  image_join() %&gt;%\r\n  image_animate(fps=2, loop=1) %&gt;%\r\n  image_write(&quot;drought.gif&quot;)<\/code><\/pre>\n<p>NOTE: an updated, comment-free version of the above code block is in <a href=\"https:\/\/gist.github.com\/hrbrmstr\/c8e001168e1ed7369c637be0589ed768\">this gist<\/a> and uses <code>spdplyr::filter()<\/code> vs <code>subset()<\/code>, keeps downloaded files tidy in a temporary directory and includes a progress bar vs raw, ugly <code>download.file()<\/code> messages.<\/p>\n<p><center><a href=\"\/dl\/2016dm.gif\" target=\"_blank\"><img decoding=\"async\" src=\"\/dl\/2016dm.gif\" style=\"max-width:100%\"\/><\/a><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is another purrr-focused post but it&#8217;s also an homage to the nascent magick package (R interface to ImageMagick) by @opencpu. We&#8217;re starting to see\/feel the impact of the increasing drought up here in southern Maine. I&#8217;ve used the data from the U.S. Drought Monitor before on the blog, but they also provide shapefiles and [&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,753,706,91],"tags":[810],"class_list":["post-4574","post","type-post","status-publish","format-standard","hentry","category-cartography","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>U.S. Drought Animations with the &quot;Witch&#039;s Brew&quot; (purrr + broom + magick) - 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\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"U.S. Drought Animations with the &quot;Witch&#039;s Brew&quot; (purrr + broom + magick) - rud.is\" \/>\n<meta property=\"og:description\" content=\"This is another purrr-focused post but it&#8217;s also an homage to the nascent magick package (R interface to ImageMagick) by @opencpu. We&#8217;re starting to see\/feel the impact of the increasing drought up here in southern Maine. I&#8217;ve used the data from the U.S. Drought Monitor before on the blog, but they also provide shapefiles and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-27T14:08:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-09T11:26:21+00:00\" \/>\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\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"U.S. Drought Animations with the &#8220;Witch&#8217;s Brew&#8221; (purrr + broom + magick)\",\"datePublished\":\"2016-07-27T14:08:54+00:00\",\"dateModified\":\"2018-07-09T11:26:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/\"},\"wordCount\":295,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"keywords\":[\"post\"],\"articleSection\":[\"cartography\",\"ggplot\",\"maps\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/\",\"name\":\"U.S. Drought Animations with the \\\"Witch's Brew\\\" (purrr + broom + magick) - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"datePublished\":\"2016-07-27T14:08:54+00:00\",\"dateModified\":\"2018-07-09T11:26:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/07\\\/27\\\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"U.S. Drought Animations with the &#8220;Witch&#8217;s Brew&#8221; (purrr + broom + magick)\"}]},{\"@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 Animations with the \"Witch's Brew\" (purrr + broom + magick) - 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\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/","og_locale":"en_US","og_type":"article","og_title":"U.S. Drought Animations with the \"Witch's Brew\" (purrr + broom + magick) - rud.is","og_description":"This is another purrr-focused post but it&#8217;s also an homage to the nascent magick package (R interface to ImageMagick) by @opencpu. We&#8217;re starting to see\/feel the impact of the increasing drought up here in southern Maine. I&#8217;ve used the data from the U.S. Drought Monitor before on the blog, but they also provide shapefiles and [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/","og_site_name":"rud.is","article_published_time":"2016-07-27T14:08:54+00:00","article_modified_time":"2018-07-09T11:26:21+00:00","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\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"U.S. Drought Animations with the &#8220;Witch&#8217;s Brew&#8221; (purrr + broom + magick)","datePublished":"2016-07-27T14:08:54+00:00","dateModified":"2018-07-09T11:26:21+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/"},"wordCount":295,"commentCount":4,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"keywords":["post"],"articleSection":["cartography","ggplot","maps","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/","url":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/","name":"U.S. Drought Animations with the \"Witch's Brew\" (purrr + broom + magick) - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"datePublished":"2016-07-27T14:08:54+00:00","dateModified":"2018-07-09T11:26:21+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/07\/27\/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"U.S. Drought Animations with the &#8220;Witch&#8217;s Brew&#8221; (purrr + broom + magick)"}]},{"@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-1bM","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6067,"url":"https:\/\/rud.is\/b\/2017\/06\/05\/r%e2%81%b6-scraping-images-to-pdfs\/","url_meta":{"origin":4574,"position":0},"title":"R\u2076 \u2014 Scraping Images To PDFs","author":"hrbrmstr","date":"2017-06-05","format":false,"excerpt":"I've been doing intermittent prep work for a follow-up to an earlier post on store closings and came across this CNN Money \"article\" on it. Said \"article\" is a deliberately obfuscated or lazily crafted series of GIF images that contain all the Radio Shack impending store closings. It's the most\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5206,"url":"https:\/\/rud.is\/b\/2017\/03\/27\/all-in-on-r%e2%81%b4-progress-bars-on-first-post\/","url_meta":{"origin":4574,"position":1},"title":"All-in on R\u2076 : Progress [bars] on first post","author":"hrbrmstr","date":"2017-03-27","format":false,"excerpt":"@eddelbuettel's idea is a good one. (it's a quick read\u2026jump there and come back). We'll avoid confusion and call it R\u2076 over here. Feel free to don the superclass. I often wait for a complete example or new package announcement to blog something when a briefly explained snippet might have\u2026","rel":"","context":"In &quot;dplyr&quot;","block_context":{"text":"dplyr","link":"https:\/\/rud.is\/b\/category\/dplyr\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4560,"url":"https:\/\/rud.is\/b\/2016\/07\/26\/use-quick-formula-functions-in-purrrmap-base-vs-tidtyverse-idiom-comparisonsexamples\/","url_meta":{"origin":4574,"position":2},"title":"Use quick formula functions in purrr::map (+ base vs tidtyverse idiom comparisons\/examples)","author":"hrbrmstr","date":"2016-07-26","format":false,"excerpt":"I've converted the vast majority of my *apply usage over to purrr functions. In an attempt to make this a quick post, I'll refrain from going into all the benefits of the purrr package. Instead, I'll show just one thing that's super helpful: formula functions. After seeing this Quartz article\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"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":4574,"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":11612,"url":"https:\/\/rud.is\/b\/2018\/10\/10\/geojson-version-of-cbc-quebec-ridings-hex-cartograms-with-example-usage-in-r\/","url_meta":{"origin":4574,"position":4},"title":"GeoJSON  Version of CBC Quebec Ridings Hex Cartograms with  Example Usage in R","author":"hrbrmstr","date":"2018-10-10","format":false,"excerpt":"The CBC covered the recent (as of the original post-time on this blog entry) Quebec elections and used a well-crafted hex grid map to display results: They have a great 'splainer on why they use this type of map. Thinking that it may be useful for others, I used a\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\/2018\/10\/ggplot-sf.png?fit=1200%2C900&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/10\/ggplot-sf.png?fit=1200%2C900&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/10\/ggplot-sf.png?fit=1200%2C900&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/10\/ggplot-sf.png?fit=1200%2C900&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/10\/ggplot-sf.png?fit=1200%2C900&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":6917,"url":"https:\/\/rud.is\/b\/2017\/10\/30\/gg_tweeting-power-outages\/","url_meta":{"origin":4574,"position":5},"title":"gg_tweet&#8217;ing Power Outages","author":"hrbrmstr","date":"2017-10-30","format":false,"excerpt":"As many folks know, I live in semi-rural Maine and we were hit pretty hard with a wind+rain storm Sunday to Monday. The hrbrmstr compound had no power (besides a generator) and no stable\/high-bandwidth internet (Verizon LTE was heavily congested) since 0500 Monday and still does not as I write\u2026","rel":"","context":"In &quot;ggplot&quot;","block_context":{"text":"ggplot","link":"https:\/\/rud.is\/b\/category\/ggplot\/"},"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\/4574","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=4574"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4574\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=4574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=4574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=4574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}