{"id":1120,"date":"2012-04-12T16:56:09","date_gmt":"2012-04-12T20:56:09","guid":{"rendered":"http:\/\/anthony.darrouzet-nardi.net\/scienceblog\/?p=1120"},"modified":"2012-04-12T16:56:09","modified_gmt":"2012-04-12T20:56:09","slug":"ggplot2-im-a-convert","status":"publish","type":"post","link":"http:\/\/scienceblog.darrouzet-nardi.net\/?p=1120","title":{"rendered":"ggplot2: I&#8217;m a convert"},"content":{"rendered":"<p>I have been using <code>lattice<\/code>\u00a0 for my R graphics for years, and it is a great software package based on William Cleveland&#8217;s <a href=\"http:\/\/www.amazon.com\/Visualizing-Data-William-S-Cleveland\/dp\/0963488406\/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1334175377&amp;sr=1-1\">groundbreaking approach<\/a> to analyzing data. However, a few weeks ago I was trying to show data points, means, and summary bars in the same graphic, a task that should be straightforward in a graphics environment. This is not impossible in <code>lattice<\/code>, but does involve writing a cumbersome &#8220;panel function.&#8221; This approach was great for its time \u2013 when <code>lattice<\/code> came out there was nothing else like it \u2013 but unfortunately it\u00a0has not evolved into a more user-friendly system.<\/p>\n<p>Having read about <code>ggplot2<\/code>, I knew that it had a more modular system where you can add or subtract different graphical elements such as summary stats or data points at will. So, I tried it for the data I was working on and never looked back.<\/p>\n<p>Here&#8217;s my first\u00a0<code>ggplot2<\/code> figure that drew me to switch:<\/p>\n<p><a href=\"http:\/\/anthony.darrouzet-nardi.net\/scienceblog\/wp-content\/uploads\/2012\/04\/mldh_fig1.gif\"><img loading=\"lazy\" class=\"aligncenter size-large wp-image-1126\" title=\"mldh_fig1\" src=\"http:\/\/anthony.darrouzet-nardi.net\/scienceblog\/wp-content\/uploads\/2012\/04\/mldh_fig1-450x142.gif\" alt=\"\" width=\"450\" height=\"142\" srcset=\"http:\/\/scienceblog.darrouzet-nardi.net\/wp-content\/uploads\/2012\/04\/mldh_fig1-450x142.gif 450w, http:\/\/scienceblog.darrouzet-nardi.net\/wp-content\/uploads\/2012\/04\/mldh_fig1-300x94.gif 300w, http:\/\/scienceblog.darrouzet-nardi.net\/wp-content\/uploads\/2012\/04\/mldh_fig1.gif 804w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>It took minimal effort to learn the <code>ggplot2<\/code> system. In addition to the useful modular design, the default approaches to tasks such as automatic legend creation, log axes, and jittering are well done.<\/p>\n<p>While I know an upgrade when I see one, I will also miss <code>lattice<\/code> since I think it&#8217;s a fantastic piece of open source software that was my analysis workhorse for the last eight years. It was also one of the packages that really motivated me to learn R.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been using lattice\u00a0 for my R graphics for years, and it is a great software package based on William Cleveland&#8217;s groundbreaking approach to analyzing data. However, a few weeks ago I was trying to show data points, means, and summary bars in the same graphic, a task that should be straightforward in a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=\/wp\/v2\/posts\/1120"}],"collection":[{"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1120"}],"version-history":[{"count":15,"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=\/wp\/v2\/posts\/1120\/revisions"}],"predecessor-version":[{"id":1138,"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=\/wp\/v2\/posts\/1120\/revisions\/1138"}],"wp:attachment":[{"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1120"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/scienceblog.darrouzet-nardi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}