

{"id":4049,"date":"2016-03-07T09:02:41","date_gmt":"2016-03-07T14:02:41","guid":{"rendered":"http:\/\/rud.is\/b\/?p=4049"},"modified":"2018-03-07T16:42:46","modified_gmt":"2018-03-07T21:42:46","slug":"primary-plotting","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/","title":{"rendered":"Primary Plotting"},"content":{"rendered":"<p>My wife tricked me into a partial-weekend project to try to get all the primary\/caucus results to-date on a map (the whole us). This is challenging since not all states use counties as boundaries for aggregate results. I&#8217;m still piecing together some shapefiles for the primary\/caucus summation boundaries for a couple remaining states but I didn&#8217;t want to let the data source for the election results go without a mention. <\/p>\n<p>The bestest part of the `iframe` below (which can be busted with [this link](\/projects\/primaryplotting.html)) is the CNN JSON link. You can discover those with Developer Tools on any modern browser. Here&#8217;s [the rest](https:\/\/gist.github.com\/hrbrmstr\/25a53e2fcaee2aafa908) of those links (using a gist to add enough layers of redirection to hopefully keep this data free\/available). <\/p>\n<p>It&#8217;s really well-formatted JSON. As of this post, not all those links completely work (the Maine &#038; PR results weren&#8217;t certified yet). Please credit the hard-working folks at CNN whenever\/wherever you use this data (if you use it at all). Making a resource like this available is a great service (even if it wasn&#8217;t 100% intentional).<\/p>\n<p>The rest of the post shows how to display the voting % per top-candidate in each Texas county. Because Texas uses counties for roll-up aggregation, we can also use `tigris` to get great maps.<\/p>\n<p><center><br \/>\n<iframe loading=\"lazy\" style=\"max-width=100%\" \n        src=\"\/projects\/primaryplotting.html\" \n        sandbox=\"allow-same-origin allow-scripts\" \n        width=\"100%\" \n        height=\"900\" \n        scrolling=\"yes\" \n        seamless=\"seamless\" \n        frameBorder=\"0\"><\/iframe><br \/>\n<\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My wife tricked me into a partial-weekend project to try to get all the primary\/caucus results to-date on a map (the whole us). This is challenging since not all states use counties as boundaries for aggregate results. I&#8217;m still piecing together some shapefiles for the primary\/caucus summation boundaries for a couple remaining states but I [&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":[673,674,753,720,706,91],"tags":[810],"class_list":["post-4049","post","type-post","status-publish","format-standard","hentry","category-datavis-2","category-dataviz","category-ggplot","category-gis","category-maps","category-r","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Primary Plotting - 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\/07\/primary-plotting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Primary Plotting - rud.is\" \/>\n<meta property=\"og:description\" content=\"My wife tricked me into a partial-weekend project to try to get all the primary\/caucus results to-date on a map (the whole us). This is challenging since not all states use counties as boundaries for aggregate results. I&#8217;m still piecing together some shapefiles for the primary\/caucus summation boundaries for a couple remaining states but I [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-07T14:02:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:42:46+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\/03\/07\/primary-plotting\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Primary Plotting\",\"datePublished\":\"2016-03-07T14:02:41+00:00\",\"dateModified\":\"2018-03-07T21:42:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/\"},\"wordCount\":232,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"keywords\":[\"post\"],\"articleSection\":[\"DataVis\",\"DataViz\",\"ggplot\",\"gis\",\"maps\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/\",\"url\":\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/\",\"name\":\"Primary Plotting - rud.is\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/#website\"},\"datePublished\":\"2016-03-07T14:02:41+00:00\",\"dateModified\":\"2018-03-07T21:42:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rud.is\/b\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Primary Plotting\"}]},{\"@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":"Primary Plotting - 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\/07\/primary-plotting\/","og_locale":"en_US","og_type":"article","og_title":"Primary Plotting - rud.is","og_description":"My wife tricked me into a partial-weekend project to try to get all the primary\/caucus results to-date on a map (the whole us). This is challenging since not all states use counties as boundaries for aggregate results. I&#8217;m still piecing together some shapefiles for the primary\/caucus summation boundaries for a couple remaining states but I [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/","og_site_name":"rud.is","article_published_time":"2016-03-07T14:02:41+00:00","article_modified_time":"2018-03-07T21:42:46+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\/03\/07\/primary-plotting\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Primary Plotting","datePublished":"2016-03-07T14:02:41+00:00","dateModified":"2018-03-07T21:42:46+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/"},"wordCount":232,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"keywords":["post"],"articleSection":["DataVis","DataViz","ggplot","gis","maps","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/","url":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/","name":"Primary Plotting - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"datePublished":"2016-03-07T14:02:41+00:00","dateModified":"2018-03-07T21:42:46+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/03\/07\/primary-plotting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Primary Plotting"}]},{"@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-13j","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":18584,"url":"https:\/\/rud.is\/b\/2024\/03\/23\/vulnchecks-free-community-kev-cve-apis-code-golang-cli-utility\/","url_meta":{"origin":4049,"position":0},"title":"VulnCheck&#8217;s Free Community KEV &#038; CVE APIs  (Code &#038; Golang CLI Utility)","author":"hrbrmstr","date":"2024-03-23","format":false,"excerpt":"VulnCheck has some new, free API endpoints for the cybersecurity community. Two extremely useful ones are for their extended version of CISA\u2019s KEV, and an in-situ replacement for NVD\u2019s sad excuse for an API and soon-to-be-removed JSON feeds. There are two ways to work with these APIs. One is retrieve\u2026","rel":"","context":"In &quot;APIs&quot;","block_context":{"text":"APIs","link":"https:\/\/rud.is\/b\/category\/apis\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25048,"url":"https:\/\/rud.is\/b\/2025\/04\/27\/new-geolocus-cli-for-onyphes-geolocus-database\/","url_meta":{"origin":4049,"position":1},"title":"New geolocus-cli For ONYPHE&#8217;s Geolocus Database","author":"hrbrmstr","date":"2025-04-27","format":false,"excerpt":"ONYPHE has made available a free API and free MMDB download of their new Geolocus database. It provided IP address metadata in the form of: { \"abuse\": [ \"amzn-noc-contact@amazon.com\", \"aws-routing-poc@amazon.com\", \"aws-rpki-routing-poc@amazon.com\", \"trustandsafety@support.aws.com\" ], \"asn\": \"AS14618\", \"continent\": \"NA\", \"continentname\": \"North America\", \"country\": \"US\", \"countryname\": \"United States\", \"domain\": [ \"amazon.com\", \"amazonaws.com\", \"aws.com\"\u2026","rel":"","context":"In &quot;Cybersecurity&quot;","block_context":{"text":"Cybersecurity","link":"https:\/\/rud.is\/b\/category\/cybersecurity\/"},"img":{"alt_text":"compass on map","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2025\/04\/getty-images-95WsGwmiZk4-unsplash-1.jpg?fit=512%2C419&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3919,"url":"https:\/\/rud.is\/b\/2016\/02\/10\/craft-httr-calls-cleverly-with-curlconverter\/","url_meta":{"origin":4049,"position":2},"title":"Craft httr calls cleverly with curlconverter","author":"hrbrmstr","date":"2016-02-10","format":false,"excerpt":"UPDATE curlconverter will now return (as the function return value) a working R function. See the README for examples When you visit a site like the LA Times' NH Primary Live Results site and wish you had the data that they used to make the tables & visualizations on the\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":2637,"url":"https:\/\/rud.is\/b\/2013\/09\/08\/rforecastio-simple-r-package-to-access-forecast-io-weather-data\/","url_meta":{"origin":4049,"position":3},"title":"Rforecastio &#8211; Simple R Package To Access forecast.io Weather Data","author":"hrbrmstr","date":"2013-09-08","format":false,"excerpt":"It doesn't get much better for me than when I can combine R and weather data in new ways. I've got something brewing with my Nest thermostat and needed to get some current wx readings plus forecast data. I could have chosen a number of different sources or API's but\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/rud.is\/b\/category\/development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1532,"url":"https:\/\/rud.is\/b\/2012\/07\/20\/veris-community-json-vs-xml\/","url_meta":{"origin":4049,"position":4},"title":"VERIS Community :: JSON vs XML","author":"hrbrmstr","date":"2012-07-20","format":false,"excerpt":"You may not be aware of the fact that the #spiffy Verizon Biz folk have some VERIS open source components, one of which is the XML schema for the \"Vocabulary for Event Recording and Incident Sharing\". While most Java-backends will readily slurp up and spit back archaic XML data, the\u2026","rel":"","context":"In &quot;Information Security&quot;","block_context":{"text":"Information Security","link":"https:\/\/rud.is\/b\/category\/information-security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6091,"url":"https:\/\/rud.is\/b\/2017\/06\/17\/replicating-the-apache-drill-yelp-academic-dataset-with-sergeant\/","url_meta":{"origin":4049,"position":5},"title":"Replicating the Apache Drill &#8216;Yelp&#8217; Academic Dataset Analysis with sergeant","author":"hrbrmstr","date":"2017-06-17","format":false,"excerpt":"The Apache Drill folks have a nice walk-through tutorial on how to analyze the Yelp Academic Dataset with Drill. It's a bit out of date (the current Yelp data set structure is different enough that the tutorial will error out at various points), but it's a great example of how\u2026","rel":"","context":"In &quot;Apache Drill&quot;","block_context":{"text":"Apache Drill","link":"https:\/\/rud.is\/b\/category\/apache-drill\/"},"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\/4049","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=4049"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4049\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=4049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=4049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=4049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}