

{"id":3756,"date":"2015-10-24T10:43:46","date_gmt":"2015-10-24T15:43:46","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3756"},"modified":"2018-03-07T16:43:27","modified_gmt":"2018-03-07T21:43:27","slug":"less-drama-more-encoding","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/","title":{"rendered":"Less Drama, More Encoding"},"content":{"rendered":"<p>Junk Charts [adeptly noted and fixed](http:\/\/junkcharts.typepad.com\/junk_charts\/2015\/10\/is-it-worth-the-drama.html) this excessively stylized chart from the WSJ this week:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3757\" data-permalink=\"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/6a00d8341e992c53ef01bb0885a274970d\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/6a00d8341e992c53ef01bb0885a274970d.jpg?fit=1280%2C583&amp;ssl=1\" data-orig-size=\"1280,583\" 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=\"6a00d8341e992c53ef01bb0885a274970d\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/6a00d8341e992c53ef01bb0885a274970d.jpg?fit=510%2C232&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/6a00d8341e992c53ef01bb0885a274970d.jpg?resize=510%2C232&#038;ssl=1\" alt=\"6a00d8341e992c53ef01bb0885a274970d\" width=\"510\" height=\"232\" class=\"aligncenter size-full wp-image-3757\" \/><\/p>\n<p>Their take on it does reduce the ZOMGOSH WE ARE DOOMED! look and feel of the WSJ chart:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3759\" data-permalink=\"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/6a00d8341e992c53ef01bb0885a2ef970d\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/6a00d8341e992c53ef01bb0885a2ef970d.png?fit=620%2C539&amp;ssl=1\" data-orig-size=\"620,539\" 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=\"6a00d8341e992c53ef01bb0885a2ef970d\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/6a00d8341e992c53ef01bb0885a2ef970d.png?fit=510%2C443&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/6a00d8341e992c53ef01bb0885a2ef970d.png?resize=510%2C443&#038;ssl=1\" alt=\"6a00d8341e992c53ef01bb0885a2ef970d\" width=\"510\" height=\"443\" class=\"aligncenter size-full wp-image-3759\" \/><\/p>\n<p>But, we can further reduce the drama by using a more neutral color encoding _and_ encode both the # of outbreaks and total size of the impacted flock populations _per week_ with a lollipop chart (and, thankfully the USDA makes this data readily available):<\/p>\n<pre lang=\"rsplus\">library(xml2)\r\nlibrary(rvest)\r\nlibrary(dplyr)\r\nlibrary(stringr)\r\nlibrary(ggplot2)\r\nlibrary(scales)\r\nlibrary(viridis)\r\nlibrary(ggthemes)\r\n\r\npg <- read_html(\"https:\/\/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\/lVNNb-IwEP0tPewx2OSbI_QDwkdBRbuQXKyJ4yTWJnYUG1D-fZ10D7RqadcHS555M_PmPRkl6IgSAWdegOZSQNW_E58stwt7PMN2NN9PHnH0_OdpE64DZ7twDSA2APzFmeL39dtV5Pf1L3i2eBjjvYMOKEEJFbrRJYqhKbkiVArNhCYVT1tou19YAZGnluSSntTwAsFrqEjJoNLldSTjioFihItctvWwxFv6zEFc4zOmGe3TiqQdURo0M62pJsBJA5TnnJK86i7Q9fwayjMU57ZPAezccnwvtdwM21aah9hcGHtuCP6Y5v_0uLHwj_S8n08XbrA2CrqhjaMHUxxMNhhH_nf1g57fdBgAtyz7MGT-ODNDnta7YLW08cpDsSEZfMli4qL9f6q2_IEsdru53xSmLejS6g1Gx5vGv6WvjB8CnxmPjp8af5ihxJNBpIqeX1HJdPgQ8VSkTmiItCxnLWtHpVQaHS-Xy-ikMhgV8oya-ncdOh23_r6E2PGqYrerD9O7u1eBlNG5\/?1dmy&#038;urile=wcm%3apath%3a%2Faphis_content_library%2Fsa_our_focus%2Fsa_animal_health%2Fsa_animal_disease_information%2Fsa_avian_health%2Fsa_detections_by_states%2Fct_ai_full_list\")\r\n\r\ndat <- html_table(html_nodes(pg, \"table\"))[[1]]\r\n\r\ndat %>% \r\n  mutate(`Confirmation date` = as.Date(`Confirmation date`, \"%b %d, %Y\"),\r\n         week = format(`Confirmation date`, \"%Y-%U\"),\r\n         week_start = as.Date(sprintf(\"%s-1\", week), \"%Y-%U-%u\") ,\r\n         `Flock size` = as.numeric(str_replace_all(`Flock size`, \",\", \"\"))) %>% \r\n  select(week, week_start, `Flock size`) %>% \r\n  filter(!is.na(`Flock size`)) %>% \r\n  group_by(week_start) %>% \r\n  summarize(outbreaks=n(), \r\n            flock_total=sum(`Flock size`)) -> dat\r\n\r\nfirst <- dat[2,]\r\nlast <- tail(dat, 1)\r\n\r\ngg <- ggplot(dat, aes(x=week_start, y=outbreaks))\r\ngg <- gg + geom_vline(xintercept=as.numeric(first$week_start), linetype=\"dashed\", size=0.2, color=\"#7f7f7f\")\r\ngg <- gg + geom_text(data=first, aes(x=week_start, y=25), label=\" First detection in 2015\", hjust=0, size=3, color=\"#7f7f7f\")\r\ngg <- gg + geom_vline(xintercept=as.numeric(last$week_start), linetype=\"dashed\", size=0.2, color=\"#7f7f7f\")\r\ngg <- gg + geom_text(data=last, aes(x=week_start, y=25), label=\"Last detection \", hjust=1, size=3, color=\"#7f7f7f\")\r\ngg <- gg + geom_segment(aes(x=week_start, xend=week_start, y=0, yend=outbreaks, color=flock_total), size=0.5)\r\ngg <- gg + geom_point(aes(size=flock_total, fill=flock_total), shape=21)\r\ngg <- gg + scale_size_continuous(name=\"Flock Impact\", label=comma, guide=\"legend\")\r\ngg <- gg + scale_color_viridis(name=\"Flock Impact\", label=comma, guide=\"legend\")\r\ngg <- gg + scale_fill_viridis(name=\"Flock Impact\", label=comma, guide=\"legend\")\r\ngg <- gg + scale_x_date(label=date_format(\"%b\"))\r\ngg <- gg + guides(color=guide_legend(), fill=guide_legend(), size=guide_legend())\r\ngg <- gg + labs(x=NULL, y=\"# Outbreaks\", title=\"Avian Flu Impact by Week (2015)\")\r\ngg <- gg + theme_tufte(base_family=\"Helvetica\")\r\ngg <- gg + theme(legend.key=element_rect(color=rgb(0,0,0,0)))\r\ngg<\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3761\" data-permalink=\"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/rstudio-4\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&amp;ssl=1\" data-orig-size=\"1740,1050\" 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=\"RStudio\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=510%2C308&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?resize=510%2C308&#038;ssl=1\" alt=\"RStudio\" width=\"510\" height=\"308\" class=\"aligncenter size-full wp-image-3761\" \/><\/p>\n<p>If we really want to see the discrete events, we can do that with our less-ZOMGOSH color scheme, too:<\/p>\n<pre lang=\"rsplus\">dat <- html_table(html_nodes(pg, \"table\"))[[1]]\r\ndat %>% \r\n  mutate(`Confirmation date` = as.Date(`Confirmation date`, \"%b %d, %Y\"),\r\n         `Flock size` = as.numeric(str_replace_all(`Flock size`, \",\", \"\"))) %>% \r\n  filter(!is.na(`Flock size`)) %>% \r\n  rename(date=`Confirmation date`) %>% \r\n  arrange(date) -> dat\r\n\r\nfirst <- dat[2,]\r\nlast <- tail(dat, 1)\r\n\r\ngg <- ggplot(dat, aes(x=date, y=`Flock size`))\r\ngg <- gg + geom_vline(xintercept=as.numeric(first$date), linetype=\"dashed\", size=0.2, color=\"#7f7f7f\")\r\ngg <- gg + geom_text(data=first, aes(x=date, y=3000000), label=\" First detection in 2015\", hjust=0, size=3, color=\"#7f7f7f\")\r\ngg <- gg + geom_vline(xintercept=as.numeric(last$date), linetype=\"dashed\", size=0.2, color=\"#7f7f7f\")\r\ngg <- gg + geom_text(data=last, aes(x=date, y=3000000), label=\"Last detection \", hjust=1, size=3, color=\"#7f7f7f\")\r\ngg <- gg + geom_segment(aes(x=date, xend=date, y=0, yend=`Flock size`, color=`Flock size`), size=0.5, alpha=1)\r\ngg <- gg + scale_size_continuous(name=\"Flock Impact\", label=comma, guide=\"legend\")\r\ngg <- gg + scale_color_viridis(name=\"Flock Impact\", label=comma, guide=\"legend\")\r\ngg <- gg + scale_fill_viridis(name=\"Flock Impact\", label=comma, guide=\"legend\")\r\ngg <- gg + scale_x_date(label=date_format(\"%b\"))\r\ngg <- gg + scale_y_continuous(label=comma)\r\ngg <- gg + guides(color=guide_legend(), fill=guide_legend(), size=guide_legend())\r\ngg <- gg + labs(x=NULL, y=\"Flock size\", title=\"Avian Flu Impact (2015)\")\r\ngg <- gg + theme_tufte(base_family=\"Helvetica\")\r\ngg <- gg + theme(legend.key=element_rect(color=rgb(0,0,0,0)))\r\ngg <\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3764\" data-permalink=\"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/rstudio-2-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio-2.png?fit=1822%2C808&amp;ssl=1\" data-orig-size=\"1822,808\" 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=\"RStudio 2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio-2.png?fit=510%2C226&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio-2.png?resize=510%2C226&#038;ssl=1\" alt=\"RStudio 2\" width=\"510\" height=\"226\" class=\"aligncenter size-full wp-image-3764\" \/><\/p>\n<p>Neither of those is ever going to sell any ads, tho.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Junk Charts [adeptly noted and fixed](http:\/\/junkcharts.typepad.com\/junk_charts\/2015\/10\/is-it-worth-the-drama.html) this excessively stylized chart from the WSJ this week: Their take on it does reduce the ZOMGOSH WE ARE DOOMED! look and feel of the WSJ chart: But, we can further reduce the drama by using a more neutral color encoding _and_ encode both the # of outbreaks and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3761,"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":[24,677,678,673,674,753,91],"tags":[810],"class_list":["post-3756","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-charts-graphs","category-data-analysis-2","category-data-visualization","category-datavis-2","category-dataviz","category-ggplot","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>Less Drama, More Encoding - 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\/10\/24\/less-drama-more-encoding\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Less Drama, More Encoding - rud.is\" \/>\n<meta property=\"og:description\" content=\"Junk Charts [adeptly noted and fixed](http:\/\/junkcharts.typepad.com\/junk_charts\/2015\/10\/is-it-worth-the-drama.html) this excessively stylized chart from the WSJ this week: Their take on it does reduce the ZOMGOSH WE ARE DOOMED! look and feel of the WSJ chart: But, we can further reduce the drama by using a more neutral color encoding _and_ encode both the # of outbreaks and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-24T15:43:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:43:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1740\" \/>\n\t<meta property=\"og:image:height\" content=\"1050\" \/>\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=\"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\\\/10\\\/24\\\/less-drama-more-encoding\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Less Drama, More Encoding\",\"datePublished\":\"2015-10-24T15:43:46+00:00\",\"dateModified\":\"2018-03-07T21:43:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/\"},\"wordCount\":118,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/RStudio.png?fit=1740%2C1050&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"Charts &amp; Graphs\",\"Data Analysis\",\"Data Visualization\",\"DataVis\",\"DataViz\",\"ggplot\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/\",\"name\":\"Less Drama, More Encoding - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/RStudio.png?fit=1740%2C1050&ssl=1\",\"datePublished\":\"2015-10-24T15:43:46+00:00\",\"dateModified\":\"2018-03-07T21:43:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/RStudio.png?fit=1740%2C1050&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/RStudio.png?fit=1740%2C1050&ssl=1\",\"width\":1740,\"height\":1050},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/10\\\/24\\\/less-drama-more-encoding\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Less Drama, More Encoding\"}]},{\"@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":"Less Drama, More Encoding - 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\/10\/24\/less-drama-more-encoding\/","og_locale":"en_US","og_type":"article","og_title":"Less Drama, More Encoding - rud.is","og_description":"Junk Charts [adeptly noted and fixed](http:\/\/junkcharts.typepad.com\/junk_charts\/2015\/10\/is-it-worth-the-drama.html) this excessively stylized chart from the WSJ this week: Their take on it does reduce the ZOMGOSH WE ARE DOOMED! look and feel of the WSJ chart: But, we can further reduce the drama by using a more neutral color encoding _and_ encode both the # of outbreaks and [&hellip;]","og_url":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/","og_site_name":"rud.is","article_published_time":"2015-10-24T15:43:46+00:00","article_modified_time":"2018-03-07T21:43:27+00:00","og_image":[{"width":1740,"height":1050,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1","type":"image\/png"}],"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\/10\/24\/less-drama-more-encoding\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Less Drama, More Encoding","datePublished":"2015-10-24T15:43:46+00:00","dateModified":"2018-03-07T21:43:27+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/"},"wordCount":118,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1","keywords":["post"],"articleSection":["Charts &amp; Graphs","Data Analysis","Data Visualization","DataVis","DataViz","ggplot","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/","url":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/","name":"Less Drama, More Encoding - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1","datePublished":"2015-10-24T15:43:46+00:00","dateModified":"2018-03-07T21:43:27+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1","width":1740,"height":1050},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2015\/10\/24\/less-drama-more-encoding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Less Drama, More Encoding"}]},{"@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\/2015\/10\/RStudio.png?fit=1740%2C1050&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-YA","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":2770,"url":"https:\/\/rud.is\/b\/2013\/10\/27\/alternative-to-grouped-bar-charts-in-r\/","url_meta":{"origin":3756,"position":0},"title":"Alternative to Grouped Bar Charts in R","author":"hrbrmstr","date":"2013-10-27","format":false,"excerpt":"The #spiffy @dseverski gave me this posit the other day: Hey, @hrbrmstr, doughnut chart aside, how would you approach the first graph at http:\/\/t.co\/zjHoHRVOeo? Bump chart? Trend line? Leave as is?\u2014 David F. Severski (@dseverski) October 25, 2013 and, I obliged shortly thereafter, but figured I'd toss a post up\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":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2013\/10\/remake.png?fit=656%2C320&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2013\/10\/remake.png?fit=656%2C320&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2013\/10\/remake.png?fit=656%2C320&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2883,"url":"https:\/\/rud.is\/b\/2014\/01\/28\/lies-damn-lies-data-journalism-and-charts-that-dont-start-at-0\/","url_meta":{"origin":3756,"position":1},"title":"Lies, Damn Lies, &#8220;Data Journalism&#8221; and Charts That Don&#8217;t Start at 0","author":"hrbrmstr","date":"2014-01-28","format":false,"excerpt":"This tweet by @moorehn (who usually is a superb economic journalist) really bugged me: Alarming chart of employment for people between 25 and 54. It's like a ski jump. #SOTUecon pic.twitter.com\/KNGYmwI88C\u2014 Heidi N. Moore (@moorehn) January 29, 2014 I grabbed the raw data from EPI: (http:\/\/www.epi.org\/files\/2012\/data-swa\/jobs-data\/Employment%20to%20population%20ratio%20(EPOPs).xls) and properly started the\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":[]},{"id":3806,"url":"https:\/\/rud.is\/b\/2015\/12\/13\/fear-of-wapo-using-bad-pie-charts-has-increased-since-last-year\/","url_meta":{"origin":3756,"position":2},"title":"Fear of WaPo Using Bad Pie Charts Has Increased Since Last Year","author":"hrbrmstr","date":"2015-12-13","format":false,"excerpt":"I woke up this morning to a [headline story from the Washington Post](https:\/\/www.washingtonpost.com\/news\/the-fix\/wp\/2015\/12\/10\/to-many-christian-terrorists-arent-true-christians-but-muslim-terrorists-are-true-muslims\/) on _\"Americans are twice as willing to distance Christian extremists from their religion as Muslims_\". This post is not about the content of the headline or story. It _is_ about the horrible pie chart WaPo led the\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"https:\/\/rud.is\/b\/category\/data-visualization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":4027,"url":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","url_meta":{"origin":3756,"position":3},"title":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2","author":"hrbrmstr","date":"2016-02-28","format":false,"excerpt":"This post comes hot off the heels of the [nigh-feature-complete release of `vegalite`](http:\/\/rud.is\/b\/2016\/02\/27\/create-vega-lite-specs-widgets-with-the-vegalite-package\/) (virtually all the components of Vega-Lite are now implemented and just need real-world user testing). I've had a few and seen a few questions about \"why Vega-Lite\"? I _think_ my previous post gave some good answers to\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":4335,"url":"https:\/\/rud.is\/b\/2016\/04\/13\/52vis-week-3-waste-not-want-not\/","url_meta":{"origin":3756,"position":4},"title":"52Vis Week #3 &#8211; Waste Not, Want Not","author":"hrbrmstr","date":"2016-04-13","format":false,"excerpt":"The Wall Street Journal did a project piece [a while back](http:\/\/projects.wsj.com\/waste-lands\/) in the _\"Waste Lands: America's Forgotten Nuclear Legacy\"_. They dug through [Department of Energy](http:\/\/www.lm.doe.gov\/default.aspx?id=2602) and [CDC](http:\/\/www.cdc.gov\/niosh\/ocas\/ocasawe.html) data to provide an overview of the lingering residue of this toxic time in America's past (somehow, I have to believe the fracking\u2026","rel":"","context":"In &quot;52vis&quot;","block_context":{"text":"52vis","link":"https:\/\/rud.is\/b\/category\/52vis\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/04\/waste.png?fit=1200%2C983&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/04\/waste.png?fit=1200%2C983&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/04\/waste.png?fit=1200%2C983&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/04\/waste.png?fit=1200%2C983&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/04\/waste.png?fit=1200%2C983&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3236,"url":"https:\/\/rud.is\/b\/2015\/01\/18\/nasa-gisss-annual-global-temperature-anomaly-trends-dplyrggplot-version\/","url_meta":{"origin":3756,"position":5},"title":"NASA GISS\u2019s Annual Global Temperature Anomaly Trends (dplyr\/ggplot version)","author":"hrbrmstr","date":"2015-01-18","format":false,"excerpt":"D Kelly O\u2019Day did a [great post](https:\/\/chartsgraphs.wordpress.com\/2015\/01\/16\/nasa-gisss-annual-global-temperature-anomaly-trends\/) on charting NASA\u2019s Goddard Institute for Space Studies (GISS) temperature anomaly data, but it sticks with base R for data munging & plotting. While there's absolutely nothing wrong with base R operations, I thought a modern take on the chart using `dplyr`, `magrittr`\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\/3756","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=3756"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3756\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/3761"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}