<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/unifying-packages-to-help-users-access-r-repositories/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://nashjc.wordpress.com/2017/09/03/unifying-packages-to-help-users-access-r-repositories/"> Blog: John C. Nash</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>With over 11,000 packages in the main CRAN (Consolidated <strong>R</strong> Archive Network) collection, users of <strong>R</strong> face a challenge when looking for tools to carry out their statistical and computational tasks, especially in subject areas outside their main domain of expertise. Moreover, a lot of packages have similar or overlapping features. Some are, to be kind, not very well written, use methods which are outdated, or are simply inappropriate to a given situation.</p>
<p>In an attempt to address this, I joined with Julia Silge and Spencer Graves to organize a special session “Navigating the R package universe” at the UseR2017 meeting in Brussels. A lot of other people contributed to the session — see <a rel="nofollow" href="https://github.com/nashjc/Rnavpkg" target="_blank">https://github.com/nashjc/Rnavpkg</a>, and especially the wiki portion, <a rel="nofollow" href="https://github.com/nashjc/Rnavpkg/wiki" target="_blank">https://github.com/nashjc/Rnavpkg/wiki</a>. The presentation materials are there, along with links to various follow-on material such as notes and this and other blog posts. In particular, there is a general follow-up blog post at <a rel="nofollow" href="https://juliasilge.com/blog/navigating-packages/" target="_blank">https://juliasilge.com/blog/navigating-packages/</a>.</p>
<p>There are lots of ideas about how to help users find the right package, but we found that we could consider them as generally falling into three categories:</p>
<ul>
<li>unification of packages that have similar goals or features (of which more in this posting)</li>
<li>guidance in the form of CRAN Task Views and similar infrastructure (see Julia’s posting <a rel="nofollow" href="https://juliasilge.com/blog/package-guidance/" target="_blank">https://juliasilge.com/blog/package-guidance/</a>)</li>
<li>search tools for R packages (pending posting by Spencer Graves)</li>
</ul>
<p>There are overlaps in these categories, and we are certain some ideas have been left out. Let us know!</p>
<h3>Approaches to unification of packages</h3>
<p>In the breakout session on unification at UseR2017, many ideas were suggested, sometimes in rapid-fire fashion. Alice Daish kindly took notes on her cell phone, but I will apologize in advance if I have missed anything important.</p>
<p>My own view of <strong>unification</strong> with regard to the package universe is to reduce the effective span of the number of “things” the user must consider. If the rule of thumb for presentations is to have no more than (fill in your favourite single digit integer) bullets per screen, surely a user should not have to face thousands of choices? Following this objective, we can consider:</p>
<ul>
<li>developing wrappers that provide a common syntax or interface to multiple packages</li>
<li>finding ways to identify packages that should not generally be used so they can be archived out of the immediate or first-level view of users who are searching for tools</li>
<li>promoting collaboration between developers of similar packages with the aim of consolidating those packages</li>
<li>encouraging those working on <strong>guidance</strong> and <strong>search</strong> to provide filtering of their output to reduce the choice burden on users.</li>
</ul>
<p>None of these approaches can be considered “easy”.</p>
<h3>Wrappers</h3>
<p>My own efforts to unifying packages have been in the field of optimization, particularly function minimization. With Ravi Varadhan, I developed the <strong>optimx</strong> package to allow a common interface to a number of base and package tools. It is an indicator of the difficulty of doing this well that I later refactored <strong>optimx</strong> to <strong>optimr</strong> to allow for easier maintenance of the package. Note that because these packages call other packages, failures in the called functions may give rise to error messages in the unifying package. To avoid too many CRAN alerts, <strong>optimrx</strong> can be found on R-forge in the <em>optimizer</em> project <a rel="nofollow" href="https://r-forge.r-project.org/projects/optimizer/" target="_blank">https://r-forge.r-project.org/projects/optimizer/</a> and can call more solvers than <strong>optimr</strong>. I believe that <strong>optimrx</strong> makes a worthwhile step towards simplifying the user’s task in carrying out function minimization where some of the parameters can also be bounded or temporarily fixed. A similar wrapper for global optimizers has been written by Hans Werner Borchers. <strong>gloptim</strong> is so far only on R-forge in the <em>optimizer</em> project. As I mentioned, writing these codes takes a lot of effort. They are never truly finished because new solvers become available from time to time.</p>
<p>A sample of some other packages which unify a number of methods:</p>
<ul>
<li><strong>mlr</strong>: Machine Learning in R</li>
<li><strong>caret</strong>: Classification And REgression Training for developing predictive models</li>
<li><strong>Matrix</strong>: Matrix methods for dense and sparse matrices (What would we do without them?)</li>
</ul>
<p>We could also consider the nls() function in the <strong>stats</strong> package that is distributed with base <strong>R</strong> to unify several methods for nonlinear least squares. Unfortunately, the default method and derivative approximation are quite often mis-applied by non-experts (and even some experts!). For the Marquardt stabilization, users must look in packages like <strong>minpack.lm</strong> and <strong>nlsr</strong>. Duncan Murdoch and I wrote the last package to allow for analytic derivatives of expressions in nonlinear modelling, but it would be nice to be able to use them in conjunction with separable models (essentially those with linear structure with some nonlinear terms). While <strong>nlsr </strong>has a wrapnls() function to call nls(), we don’t yet have a way to access <strong>minpack.lm </strong>or some other packages with relevant features. There is always more work to do!</p>
<h3>Archiving</h3>
<p>During the breakout session on unification, there were a lot of comments about packages that should be merged, as well as a few about packages that should be abandoned. A subtext of the discussion that is relevant to <strong>R</strong> in general is that younger workers were quite clear that they felt they could not voice their opinions openly because some packages had been written by members of well-established groups who might provide employment opportunities or other perks. In this, the fact that two of the session organizers (JN and SG) are retired and the third (JS) does not work in academia was noted. We are relatively protected from backlash to honest commentary. Here I genuinely mean <strong>honest</strong> and not capriciously critical. We must recognize that many packages have been important in the life of <strong>R</strong> but now need renewal or replacement. I have been trying to get my own contributions to the optim() function deprecated for some time! However, there are workers who, I am sure, will for a variety of reasons be unwilling to discuss ways to reorganize the package repositories.</p>
<p>Ultimately, the users will vote with their feet (or rather mouse/touchpad). However, there will be a lot of wasted effort that does them and <strong>R</strong> no good whatever.</p>
<h3>Filtered presentation</h3>
<p>The CRAN repository is, at present, offered to users as a list alphabetically or by date on the different mirrors, (e.g., https://cloud.r-project.org/). While a way to see every package available is necessary, it is far from friendly to users, either novices or experts. Clearly it is feasible to restructure the list(s) for different audiences. Moreover, this restructuring or filtering need not be on the CRAN sites, but could be delegated to sites dealing with particular applications or methods. Here is a prime area of overlap with the <strong>guidance</strong> and <strong>search</strong> ideas for navigating the packages. In particular, it will be helpful if automated tools are developed that do the lion’s share of the work for this.</p>
<p>Another approach to filtering is to present <strong>R</strong> tools within a different framework. <a rel="nofollow" href="https://www.jamovi.org/" target="_blank">https://www.jamovi.org/</a> uses a spreadsheet paradigm. <a rel="nofollow" href="https://www.tidyverse.org/" target="_blank">https://www.tidyverse.org/</a> collects tools that deal with data science and adds a streamlined command set. Unfortunately, there is a learning cost to using new frameworks like these. They simplify the use of <strong>R</strong> in one domain, but add to the general collection of packages and tools.</p>
<h3>Directions</h3>
<p>Unification of <strong>R</strong> packages with the aim to reduce user costs in finding the right tools is never going to be trivial. Moreover, it is not as directly rewarding as writing an (apparently) new package or method, and getting a paper published abut it. On the other hand, making <strong>R</strong> infrastructure more accessible to users is key to continued vitality of the overall resource and community.</p>
<p><em>John C. Nash</em>     2017-9-3</p>
<p> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nashjc.wordpress.com/231/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/comments/nashjc.wordpress.com/231/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"></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="https://nashjc.wordpress.com/2017/09/03/unifying-packages-to-help-users-access-r-repositories/"> Blog: John C. Nash</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 rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/bQEF-rtZOQk" height="1"></a></div>