

{"id":4027,"date":"2016-02-28T12:05:15","date_gmt":"2016-02-28T17:05:15","guid":{"rendered":"http:\/\/rud.is\/b\/?p=4027"},"modified":"2018-03-07T16:43:06","modified_gmt":"2018-03-07T21:43:06","slug":"a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","title":{"rendered":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2"},"content":{"rendered":"<p>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&#8217;ve had a few and seen a few questions about &#8220;why Vega-Lite&#8221;? I _think_ my previous post gave some good answers to &#8220;why&#8221;. However, Vega-Lite and Vega provide different ways to think about composing statistical graphs than folks seem to be used to (which is part of the &#8220;why?&#8221;). <\/p>\n<p>Vega-Lite attempts to simplify the way charts are specified (i.e. the way you create a &#8220;spec&#8221;) in Vega. Vega-proper is rich and complex. You interleave data, operations on data, chart aesthetics and chart element interactions all in one giant JSON file. Vega-Lite 1.0 is definitely more limited than Vega-proper and even when it does add more interactivity (like &#8220;brushing&#8221;) it will _still_ be more limited, _on purpose_. The reduction in complexity makes it more accessible to both humans and apps, especially apps that don&#8217;t grok the Grammar of Graphics (GoG) well. <\/p>\n<p>Even though `ggplot2` lets you mix and match statistical operations on data, I&#8217;m going to demonstrate the difference in paradigms\/idioms through a single chart. I grabbed the [FRED data on historical WTI crude oil prices](https:\/\/research.stlouisfed.org\/fred2\/series\/DCOILWTICO) and will show a chart that displays the minimum monthly price per-decade for a barrel of this cancerous, greed-inducing, global-conflict-generating, atmosphere-destroying black gold. <\/p>\n<p>The data consists of records of daily prices (USD) for this commodity. That means we have to:<\/p>\n<p>1. compute the decade<br \/>\n2. compute the month<br \/>\n3. determine the minimum price by month and decade<br \/>\n4. plot the values<\/p>\n<p>The goal of each idiom is to provide a way to reproduce and communicate the &#8220;research&#8221;.<\/p>\n<p>Here&#8217;s the idiomatic way of doing this with Vega-Lite:<\/p>\n<pre lang=\"rsplus\">library(vegalite)\r\nlibrary(quantmod)\r\nlibrary(dplyr)\r\n\r\ngetSymbols(\"DCOILWTICO\", src=\"FRED\")\r\n\r\ndata_frame(date=index(DCOILWTICO),\r\n           value=coredata(DCOILWTICO)[,1]) %>%\r\n  mutate(decade=sprintf(\"%s0\", substring(date, 1, 3))) -> oil\r\n\r\n# i created a CSV and moved the file to my server for easier embedding but\r\n# could just have easily embedded the data in the spec.\r\n# remember, you can pipe a vegalite object to embed_spec() to\r\n# get javascript embed code.\r\n\r\nvegalite() %>%\r\n  add_data(\"http:\/\/rud.is\/dl\/crude.csv\") %>%\r\n  encode_x(\"date\", \"temporal\") %>%\r\n  encode_y(\"value\", \"quantitative\", aggregate=\"min\") %>%\r\n  encode_color(\"decade\", \"nominal\") %>%\r\n  timeunit_x(\"month\") %>%\r\n  axis_y(title=\"\", format=\"$3d\") %>%\r\n  axis_x(labelAngle=45, labelAlign=\"left\", \r\n         title=\"Min price for Crude Oil (WTI) by month\/decade, 1986-present\") %>%\r\n  mark_tick(thickness=3) %>%\r\n  legend_color(title=\"Decade\", orient=\"left\")<\/pre>\n<p>Here&#8217;s the &#8220;spec&#8221; that creates (wordpress was having issues with it, hence the gist embed):<\/p>\n<p><script src=\"https:\/\/gist.github.com\/hrbrmstr\/7f9c4de02c08ddef4ac6.js\"><\/script><\/p>\n<p>And, here&#8217;s the resulting visualization:<\/p>\n<p><center><\/p>\n<div id=\"vl37b06857\" class=\"vldiv\"><\/div>\n<p><\/center><\/p>\n<p><script>\nvar spec_vl37b06857 = JSON.parse('{\"description\":\"\",\"data\":{\"url\":\"http:\/\/rud.is\/dl\/crude.csv\"},\"mark\":\"tick\",\"encoding\":{\"x\":{\"field\":\"date\",\"type\":\"temporal\",\"timeUnit\":\"month\",\"axis\":{\"labels\":true,\"labelAngle\":45,\"labelAlign\":\"left\",\"labelMaxLength\":25,\"title\":\"Min price for Crude Oil (WTI) by month\/decade, 1986-present\",\"characterWidth\":6}},\"y\":{\"field\":\"value\",\"type\":\"quantitative\",\"aggregate\":\"min\",\"axis\":{\"labels\":true,\"labelMaxLength\":25,\"title\":\"\",\"characterWidth\":6,\"format\":\"$3d\"}},\"color\":{\"field\":\"decade\",\"type\":\"nominal\",\"legend\":{\"orient\":\"left\",\"title\":\"Decade\"}}},\"config\":{\"mark\":{\"tickThickness\":3}},\"embed\":{\"renderer\":\"svg\",\"actions\":{\"export\":false,\"source\":false,\"editor\":false}}}');<\/p>\n<p>var embedSpec_vl37b06857 = { \"mode\": \"vega-lite\", \"spec\": spec_vl37b06857, \"renderer\": spec_vl37b06857.embed.renderer, \"actions\": spec_vl37b06857.embed.actions };<\/p>\n<p>vg.embed(\"#vl37b06857\", embedSpec_vl37b06857, function(error, result) {});\n<\/script><\/p>\n<p>The grouping and aggregation operations operate in-chart-craft-situ. You have to carefully, visually parse either the spec or the R code that creates the spec to really grasp what&#8217;s going on. A different way of looking at this is that you embed everything you need to reproduce the transformations and visual encodings in a single, simple JSON file.<\/p>\n<p>Here&#8217;s what I believe to be the modern, idiomatic way to do this in R + `ggplot2`:<\/p>\n<pre lang=\"rsplus\">library(ggplot2)\r\nlibrary(quantmod)\r\nlibrary(dplyr)\r\n\r\ngetSymbols(\"DCOILWTICO\", src=\"FRED\")\r\n\r\ndata_frame(date=index(DCOILWTICO),\r\n           value=coredata(DCOILWTICO)[,1]) %>%\r\n  mutate(decade=sprintf(\"%s0\", substring(date, 1, 3)),\r\n         month=factor(format(as.Date(date), \"%B\"),\r\n                      levels=month.name)) -> oil\r\n\r\nfilter(oil, !is.na(value)) %>%\r\n  group_by(decade, month) %>%\r\n  summarise(value=min(value)) %>%\r\n  ungroup() -> oil_summary\r\n\r\nggplot(oil_summary, aes(x=month, y=value, group=decade)) +\r\n  geom_point(aes(color=decade), shape=95, size=8) +\r\n  scale_y_continuous(labels=scales::dollar) +\r\n  scale_color_manual(name=\"Decade\", \r\n                     values=c(\"#d42a2f\", \"#fd7f28\", \"#339f34\", \"#d42a2f\")) +\r\n  labs(x=\"Min price for Crude Oil (WTI) by month\/decade, 1986-present\", y=NULL) +\r\n  theme_bw() +\r\n  theme(axis.text.x=element_text(angle=-45, hjust=0)) +\r\n  theme(legend.position=\"left\") +\r\n  theme(legend.key=element_blank()) +\r\n  theme(plot.margin=grid::unit(rep(1, 4), \"cm\"))<\/pre>\n<p><center><img decoding=\"async\" src=\"\/dl\/crude.svg\"\/><\/center><\/p>\n<p>(To stave off some comments, yes I do know you can be Vega-like and compute with arbitrary functions within ggplot2. This was meant to show what I&#8217;ve seen to be the modern, recommended idiom.)<\/p>\n<p>You really don&#8217;t even need to know R (for the most part) to grok what&#8217;s going on. Data is acquired and transformed and we map that into the plot. Yes, you can do the same thing with Vega[-Lite] (i.e. munge the data ahead of time and just churn out marks) but _you&#8217;re not encouraged to_. The power of the Vega paradigm is that you _do blend data and operations together_ and they _stay together_.<\/p>\n<p>To make the R+ggplot2 code reproducible the entirety of the script has to be shipped. It&#8217;s really the same as shipping the Vega[-Lite] spec, though since you need to reproduce either the JSON or the R code in environments that support the code (R just happens to support both ggplot2 &#038; Vega-Lite now :-). <\/p>\n<p>I like the latter approach but can appreciate both (otherwise I wouldn&#8217;t have written the `vegalite` package). I also think Vega-Lite will catch on more than Vega-proper did (though Vega itself is in use and you use under the covers whenever you use `ggvis`). If Vega-Lite does nothing more than improve visualization literacy\u2014you _must_ understand core vis terms to use it\u2014and foster the notion for the need for serialization, reproduction and sharing of basic statistical charts, it will have been an amazing success in my book.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;ve had a few and seen a few questions about &#8220;why Vega-Lite&#8221;? I _think_ my previous post gave some good answers to &#8220;why&#8221;. However, Vega-Lite and Vega [&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":[666,678,673,674,753,36,91,769,770],"tags":[810],"class_list":["post-4027","post","type-post","status-publish","format-standard","hentry","category-d3","category-data-visualization","category-datavis-2","category-dataviz","category-ggplot","category-html5","category-r","category-vega","category-vega-lite","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2 - 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\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2 - rud.is\" \/>\n<meta property=\"og:description\" content=\"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&#8217;ve had a few and seen a few questions about &#8220;why Vega-Lite&#8221;? I _think_ my previous post gave some good answers to &#8220;why&#8221;. However, Vega-Lite and Vega [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-28T17:05:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:43:06+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2\",\"datePublished\":\"2016-02-28T17:05:15+00:00\",\"dateModified\":\"2018-03-07T21:43:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/\"},\"wordCount\":668,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"keywords\":[\"post\"],\"articleSection\":[\"d3\",\"Data Visualization\",\"DataVis\",\"DataViz\",\"ggplot\",\"HTML5\",\"R\",\"vega\",\"vega-lite\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/\",\"name\":\"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2 - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"datePublished\":\"2016-02-28T17:05:15+00:00\",\"dateModified\":\"2018-03-07T21:43:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/02\\\/28\\\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2\"}]},{\"@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":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2 - 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\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","og_locale":"en_US","og_type":"article","og_title":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2 - rud.is","og_description":"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&#8217;ve had a few and seen a few questions about &#8220;why Vega-Lite&#8221;? I _think_ my previous post gave some good answers to &#8220;why&#8221;. However, Vega-Lite and Vega [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","og_site_name":"rud.is","article_published_time":"2016-02-28T17:05:15+00:00","article_modified_time":"2018-03-07T21:43:06+00:00","author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2","datePublished":"2016-02-28T17:05:15+00:00","dateModified":"2018-03-07T21:43:06+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/"},"wordCount":668,"commentCount":5,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"keywords":["post"],"articleSection":["d3","Data Visualization","DataVis","DataViz","ggplot","HTML5","R","vega","vega-lite"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","url":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","name":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2 - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"datePublished":"2016-02-28T17:05:15+00:00","dateModified":"2018-03-07T21:43:06+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2"}]},{"@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-12X","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3977,"url":"https:\/\/rud.is\/b\/2016\/02\/27\/create-vega-lite-specs-widgets-with-the-vegalite-package\/","url_meta":{"origin":4027,"position":0},"title":"Create Vega-Lite specs &#038; widgets with the vegalite package","author":"hrbrmstr","date":"2016-02-27","format":false,"excerpt":"[Vega-Lite](http:\/\/vega.github.io\/vega-lite\/) 1.0 was [released this past week](https:\/\/medium.com\/@uwdata\/introducing-vega-lite-438f9215f09e#.yfkl0tp1c). I had been meaning to play with it for a while but I've been burned before by working with unstable APIs and was waiting for this to bake to a stable release. Thankfully, there were no new shows in the Fire TV, Apple\u2026","rel":"","context":"In &quot;d3&quot;","block_context":{"text":"d3","link":"https:\/\/rud.is\/b\/category\/d3\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/gallery.png?fit=1200%2C595&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/gallery.png?fit=1200%2C595&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/gallery.png?fit=1200%2C595&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/gallery.png?fit=1200%2C595&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/gallery.png?fit=1200%2C595&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":13773,"url":"https:\/\/rud.is\/b\/2023\/03\/09\/webr-is-here\/","url_meta":{"origin":4027,"position":1},"title":"WebR IS HERE!","author":"hrbrmstr","date":"2023-03-09","format":false,"excerpt":"WebR 0.1.0 was released! I had been git-stalking George (the absolute genius who we all must thank for this) for a while and noticed the GH org and repos being updated earlier this week, So, I was already pretty excited. It dropped today, and you can hit that link for\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":2590,"url":"https:\/\/rud.is\/b\/2013\/08\/21\/zeroaccess-bots-desperately-seeking-freedom-visualization\/","url_meta":{"origin":4027,"position":2},"title":"ZeroAccess Bots Desperately Seeking Freedom (Visualization)","author":"hrbrmstr","date":"2013-08-21","format":false,"excerpt":"I've been doing a bit of graphing (with real, non-honeypot network data) as part of the research for the book I'm writing with @jayjacobs and thought one of the images was worth sharing (especially since it may not make it into the book :-). Click image for larger view This\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":"","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":4027,"position":3},"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":3784,"url":"https:\/\/rud.is\/b\/2015\/11\/11\/using-monetdblite-with-real-world-csv-files\/","url_meta":{"origin":4027,"position":4},"title":"Using MonetDB[Lite] with real-world CSV files","author":"hrbrmstr","date":"2015-11-11","format":false,"excerpt":"[MonetDBLite](https:\/\/www.monetdb.org\/blog\/monetdblite-r) (for R) was announced\/released today and, while the examples they provide are compelling there's a \"gotcha\" for potential new folks using SQL in general and SQL + MonetDB + R together. The toy example on the site shows dumping `mtcars` with `dbWriteTable` and then doing things. Real-world CSV files\u2026","rel":"","context":"In &quot;monetdb&quot;","block_context":{"text":"monetdb","link":"https:\/\/rud.is\/b\/category\/monetdb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2770,"url":"https:\/\/rud.is\/b\/2013\/10\/27\/alternative-to-grouped-bar-charts-in-r\/","url_meta":{"origin":4027,"position":5},"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":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4027","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=4027"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4027\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=4027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=4027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=4027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}