<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/our-r-package-roundup-2/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://opiateforthemass.es/articles/R-packages-in-2016/"> Opiate for the masses</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h1>A year in review</h1>
<p>And yet again, it’s that time of the year when one eats too much and gets in a reflective mood! 2016 is nearly over, and us bloggers here at opiateforthemass.es thought it would be nice to argue endlessly which R package was the best/neatest/most fun/most useful/most whatever in this year! By now, it’s become a tradition.</p>
<p>Like last year, we will each present our top pick for this year’s R package, a purely subjective list of packages we (and Chuck Norris) approve of.</p>
<p><img alt="gif" src="https://i2.wp.com/cdn.gifbay.com/2012/11/ok_chuck_norris-12381.gif?w=456" data-recalc-dims="1"></p>
<p>But do not despair, dear reader! We have also pulled hard data on R package popularity from CRAN, and will present this first.</p>
<h1>Top Popular CRAN packages</h1>
<p>Let’s start with some factual data before we go into our personal favourites of 2016. We’ll pull the titles of the new 2016 R packages from <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/cranberries/">cranberries</a>. Our <a target="_blank" rel="nofollow" href="http://opiateforthemass.es/articles/R-packages-in-2015/">approach from last year</a> no longer works, since <code>rvest::read_html</code> chokes on the <code>&lt;doi></code> tags in the page – they must have been added during this year. Instead, we read the RSS feed of Dirk’s page and go a little crazy on the <code>grep</code>. Always a healthy thing, I say. Any problem can be solved if you throw enough grep at it. Randall <a target="_blank" rel="nofollow" href="https://xkcd.com/1171/">agrees:</a></p>
<p><img alt="xkcd regexp problems" src="https://i1.wp.com/imgs.xkcd.com/comics/perl_problems.png?w=456" data-recalc-dims="1"></p>
<p>As mentioned last year, using downloads per day as a ranking metric could have the problem that earlier package releases have had more time to create a buzz and shift up the average downloads per day, skewing the data in favour of older releases. Or, it could have the complication that younger package releases are still on the early “hump” part of the downloads (let’s assume they’ll follow a log-normal (exponential decay) distribution, which most of these things do), thus skewing the data in favour of younger releases. We still don’t know, since we still didn’t bother to dig deeper into this topic. Perhaps we’ll manage next year, but I’m not going to do any New Year’s Resolutions…</p>
<p>For now, let’s again assume that average downloads per day is a relatively stable metric to gauge package success with. With some quick <code>dplyr</code> and <code>ggplot</code> magic, these are the top 20 new CRAN packages from 2016, by average number of daily downloads:</p>
<p><img alt="top 20 new CRAN packages in 2016" src="https://i1.wp.com/opiateforthemass.es/images/cran-top20-2016.png?w=456" data-recalc-dims="1"></p>
<p>The full code and data is availble <a target="_blank" rel="nofollow" href="https://github.com/Quiri/quiri.github.io/blob/master/_R/scripts/">on github</a>, of course.</p>
<p>As we can see, the main bias does not come from our choice of ranking metric, but by the fact that some packages are more “under the hood” and are pulled by many packages as dependencies, thus inflating the download statistics.</p>
<p><a target="_blank" rel="nofollow" href="https://github.com/tidyverse/tibble"><code>tibble</code></a> is Hadley’s re-take of the venerable <code>data.frame</code> and is pulled as a dependency by practically all of his packages. It was always part of <code>dplyr</code> known as <code>tbl</code> and now got an own package to keep things clean and isolated. <code>tidyverse</code> is a meta-package containing all of Hadley’s “tidy data” packages, and allows for easier loading of these. We thought about picking these as our top packages, but we settled for naming them “honorable, because obvious mentions”. We want to put some focus on the not-so-universally-known packages as well!</p>
<p>The packages (<code>sourcetools</code>, <code>hms</code>, <code>plogr</code>, <code>backports</code>) are mainly technical packages, racking up downloads by being pulled as dependencies by popular packages or by being helpful in running R code “deeply”. <code>ModelMetrics</code> contains metrics to compare <code>Rcpp</code> models. <code>rsconnect</code> and <code>miniUI</code> are packages used by <code>shiny</code>, thus their appearance high in the list.</p>
<p>Excluding these, the clear winner of “frontline” packages are <a target="_blank" rel="nofollow" href="https://github.com/krlmlr/rprojroot"><code>rprojroot</code></a>, allowing you to define your project root directory, by matching a certain criterion (for instance, a certain file is contained in that directory), <a target="_blank" rel="nofollow" href="https://github.com/hadley/forcats"><code>forcats</code></a> for making working with categorical variables easier, and <a target="_blank" rel="nofollow" href="https://github.com/hadley/modelr"><code>modelr</code></a>, enhancing the pipe workflow established by <code>magittr</code>. I must admit that I had not known of the <code>rprojroot</code> package, probably because I’m a sickler for clean directory setups.</p>
<p>An interesting find is <code>ggrepel</code>, as it’s the single “gg-packages” (of 23 in total) that made it into the top20. Since the possibility to build extensions for <code>ggplot2</code> there has been an explosion of specialised and fantastic packages to build even more, and better graphs in R. In fact, the new version of <code>ggplot2</code> should be listed as our top “new” package for 2016, if we’d count new major versions as a new package. Also this year Rstudio finally got to it’s 1.0.0 version, with many <a target="_blank" rel="nofollow" href="https://blog.rstudio.org/2016/11/01/announcing-rstudio-v1-0/">cool new features</a>.</p>
<p>But now, this blog’s authors’ personal top four of new R packages for 2016:</p>
<h1>bookdown</h1>
<p>(<a target="_blank" rel="nofollow" href="http://opiateforthemass.es/authors/#safferli">safferli’s</a> pick)</p>
<p><a target="_blank" rel="nofollow" href="https://bookdown.org/yihui/bookdown/">bookdown</a> is a specialised markdown package by the venerable <a target="_blank" rel="nofollow" href="http://yihui.name/">Yihui</a>, of <code>knitr</code> fame. It’s still early in development, but already very much productive. It’s used to build actual <em>books</em> from <code>Rmarkdown</code> documents. It can build gitbook, pdf, mobile, and html books, all from a single markdown source.</p>
<p>Being a huge LaTeX fan, I’m a little sad that with me working more with data in <code>R</code> the advent of <code>knitr</code>and now <code>bookdown</code> I actually never get to use it directly any more. For extremely specialised (and static) books or reports I would probably still move back to LaTeX, but the power and flexibility of <code>Rmarkdown</code> to build dynamic html reports outweighs the detailed configuration possibilities and pure beauty of direct LaTeX. Especially if you are using data in your reports.</p>
<p>A big thumbs up for this package. If you’re looking to write a long-ish documentation or report, currently nothing beats gitbook, and <code>bookdown</code> gives you the power of <code>R</code> and <code>Rmarkdown</code> to work with.</p>
<h1>feather</h1>
<p>(<a target="_blank" rel="nofollow" href="http://opiateforthemass.es/authors/#yuki">Yuki’s</a> pick)</p>
<p>Yuki focuses more on Python now, and will continue blogging on the blog about Python-stuff and data science topics. To honor this, we picked <code>feather</code> for Yuki, a package that makes storing dataframes to disk lightning fast and shareable between R and Python.</p>
<h1>flexdashboard</h1>
<p>(<a target="_blank" rel="nofollow" href="http://opiateforthemass.es/authors/#kirill">Kirill’s</a> pick)</p>
<p>My choice of the year I discovered quite late (2 weeks ago), so maybe I am biased, because I am still amazed by it. I was building interactive graphs with <code>highcharter</code> and wanted to share the results with my colleagues. Since I had a couple of charts, I thought I will make a Rmarkdown document and insert them there. That’s where I discovered <code>flexdashboard</code>. Basically an Rmarkdown formatter to make static dashboards. Just build some interactive graphs with any <code>htmlwidget</code> based packed (or any package you like) arrange it easily with <code>flexdashboard</code>, et voilà, you have a static easy dashboard. I even realized that in many cases, if people want to share interactive graphs with other, the go-to tool is <code>shiny</code>, but this is overengineering often if all it does is filtering the data by date or categories. The beauty of <code>flexdashboard</code> is to have a single standalone html file, which doesn’t need serve side logic or any complex stuff in the backend.</p>
<h1>ggiraph</h1>
<p>(<a target="_blank" rel="nofollow" href="http://opiateforthemass.es/authors/#jess">Jess’s</a> pick)</p>
<p>I spent 2016 discovering the beauty of <code>shinydashboard</code> building quite some dashboards with many many tabs and many many more plots. Eventually I wanted the values to be displayed when hovering over a point with the mouse. This is when <code>ggiraph</code> came to the rescue, a package written by David Grohel that extends the <code>ggplot</code> functionality and makes it easy to animate ggplots. Take a look at the <a target="_blank" rel="nofollow" href="https://davidgohel.github.io/ggiraph/index.html">website</a> and browse through the examples to see what <code>ggiraph</code> is capable of. Super easy to use with plain <code>ggplot</code> as well as with <code>shiny</code>!</p>
<p><a target="_blank" rel="nofollow" href="http://opiateforthemass.es/articles/R-packages-in-2016/">Our R package roundup</a> was originally published by Kirill Pomogajko at <a target="_blank" rel="nofollow" href="http://opiateforthemass.es/">Opiate for the masses</a> on December 31, 2016.</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://opiateforthemass.es/articles/R-packages-in-2016/"> Opiate for the masses</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/UuHNLZPSa_A"></a></div>