<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/archivist-boost-the-reproducibility-of-your-research/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://smarterpoland.pl/index.php/2017/12/boost-the-reproducibility-of-your-research-with-archivist/"> SmarterPoland.pl » English</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>A few days ago Journal of Statistical Software has published our article (in collaboration with Marcin Kosiński) <a rel="nofollow" href="https://www.jstatsoft.org/article/view/v082i11" target="_blank">archivist: An R Package for Managing, Recording and Restoring Data Analysis Results</a>. </p>
<p>Why should you care? Let’s see.</p>
<p><strong>Starter</strong></p>
<p><img alt="a" align="right" src="https://i0.wp.com/smarterpoland.pl/wp-content/uploads/2017/12/a-300x293.png?resize=300%2C293" data-recalc-dims="1"><br>
Would you want to retrieve a ggplot2 object with the plot on the right?<br>
Just call the following line in your R console.<br>
<code><br>
archivist::aread('pbiecek/Eseje/arepo/65e430c4180e97a704249a56be4a7b88')<br>
</code></p>
<p>Want to check versions of packages loaded when the plot was created?<br>
Just call<br>
<code><br>
archivist::asession('pbiecek/Eseje/arepo/65e430c4180e97a704249a56be4a7b88')<br>
</code></p>
<p><strong>Wishful Thinking?</strong></p>
<p>When people talk about reproducibility, usually they focus on tools like packrat, MRAN, docker or RSuite. These are great tools, that help to manage the execution environment in which analyses are performed. The common belief is that if one is able to replicate the execution environment then the same R source code will produce same results. </p>
<p>And it’s true in most cases, maybe even more than 99% of cases. Except that there are things in the environment that are hard to control or easy to miss. Things like external system libraries or dedicated hardware or user input. No matter what you will copy, you will never know if it was enough to recreate exactly same results in the future. So you can hope that results will be replicated, but do not bet too high.<br>
Even if some result will pop up eventually, how can you check if it’s the same result as previously?</p>
<p><strong>Literate programming is not enough</strong></p>
<p>There are other great tools like knitr, Sweave, Jupiter or others. The advantage of them is that results are rendered as tables or plots in your report. This gives you chance to verify if results obtained now and some time ago are identical.<br>
But what about more complicated results like a random forest with 100k trees created with 100k variables or some deep neural network. It will be hard to verify by eye that results are identical.</p>
<p><strong>So, what can I do?</strong></p>
<p>The safest solution would be to store copies of every object, ever created during the data analysis. All forks, wrong paths, everything. Along with detailed information which functions with what parameters were used to generate each result. Something like the ultimate TimeMachine or GitHub for R objects. </p>
<p>With such detailed information, every analysis would be auditable and replicable.<br>
Right now the full tracking of all created objects is not possible without deep changes in the R interpreter.<br>
The archivist is the light-weight version of such solution.</p>
<p><strong>What can you do with archivist?</strong></p>
<p>Use the <em>saveToRepo()</em> function to store selected R objects in the archivist repository.<br>
Use the <em>addHooksToPrint()</em> function to automatically keep copies of every plot or model or data created with knitr report.<br>
Use the <em>aread()</em> function to share your results with others or with future you. It’s the easiest way to access objects created by a remote shiny application.<br>
Use the <em>asearch()</em> function to browse objects that fit specified search criteria, like class, date of creation, used variables etc.<br>
Use <em>asession()</em> to access session info with detailed information about versions of packages available during the object creation.<br>
Use <em>ahistory()</em> to trace how given object was created.</p>
<p><strong>Lots of function, do you have a cheatsheet?</strong></p>
<p>Yes! <a rel="nofollow" href="https://raw.githubusercontent.com/pbiecek/archivist/master/cheatsheets/archivistCheatsheet.png" target="_blank">It’s here</a>.<br>
If it’s not enough, find more details <a rel="nofollow" href="https://www.jstatsoft.org/article/view/v082i11" target="_blank">in the JSS article</a>.</p>
<p><img src="https://i2.wp.com/raw.githubusercontent.com/pbiecek/archivist/master/cheatsheets/archivistCheatsheet.png?w=450&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="http://smarterpoland.pl/index.php/2017/12/boost-the-reproducibility-of-your-research-with-archivist/"> SmarterPoland.pl » English</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/Oe4rbPkvovQ" height="1"></a></div>