<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/a-thought-experiment-how-cran-saved-3620-working-lives/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://topics-in-r.blogspot.com/2018/07/a-thought-experiment-how-cran-saved.html"> Topics in R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>	Given the vast amount of R packages available today, it makes sense (at least to me, as a trained economist) to ask a simple yet difficult question: How much value has been created by all those packages? </p>
<div> <span> </span></div>
<div> <span>As all R stuff on CRAN is open-source (which is a blessing), there is no measureable GDP contribution in terms of market value that we can use to provide a quick answer. But all of us R users know the pleasant feeling, if not to say the excitement, of finding a package that provides exactly the functionality we have been looking for so long. This saves us the time of developing the functionality ourselves. So, apparantly, the time saving is one way to estimate the beneficial effect of the package sharing on CRAN.</span></div>
<div> </div>
<div> <span>Here comes a simple (and not too serious) approach to estimating this effect. </span></div>
<div> </div>
<div> (Side note: I am well aware of the extremely high concentration of capable statisticians and data scientists in the R community, so be clement with my approach, I am, as you will see shortly, not aiming at delivering a scientific paper on the matter, although it might be worthwhile to do so; if there are already papers on the topic out there, I am sure they have figured out much better approaches; in this case, please simply leave a comment below).</div>
<div> </div>
<div> <span>Without further ado, let’s get right into it: </span>Since the recordings began, the RStudio CRAN server has seen <b>1,121,724,508</b> package downloads as of today (afternoon [CET] of July 14th, 2018) (this number has been generated by running through all the <b>12,781</b> R packages identified with the <span>CRAN_package_db()</span> function from the <span>tools </span>package, and adding up their download figures which I have retrieved from the CRAN server logs via RStudio CRAN’s HTTP interface; this interface returns a JSON result which can easily be read using the <span>fromJSON()</span> function from the <span>jsonlite</span> package; to be a bit more precise: the whole operation was done with the <span>buildIndex()</span> function from my package <a rel="nofollow" href="https://cloud.r-project.org/web/packages/packagefinder/index.html" target="_blank"><span>packagefinder</span></a> as this integrates all this functionality).</div>
<div> </div>
<div> <span>Let’s assume 30% of these downloads are ‘false positives</span>‘<span>, i.e. cases in which the user realized the package is not really suitable for his/her purposes (and of course, in a more sophisticated approach we would need to account for package dependencies, as well; we neglect them here for the sake of simplicity). Removing the ‘false positives</span>‘ leaves us with <b>785,207,156</b> downloads.</div>
<div> </div>
<div> <span>Next, we assume that everyone who has downloaded a package would have developed the package’s functionality on his/her own if the package had not been available on CRAN. And let us further assume that this development effort would have taken one hour of work on average for each package. (You can play with the parameters of the model, but one hour seems really, really low, at least to me, but let’s keep it conservative for now.)</span></div>
<div> <span> </span></div>
<div> <span>But R users are not only extremely capable, almost ingenious programmers, they also have an incredible work ethic: </span>Of course, everyone who works with R is an Elon Musk-style worker, that means he or she “puts in 80 to 90 hour work weeks, every week” (Musk in his own words). So, let’s be conservative and assume an agreeable 80-hour work week (there should be at least some work-life balance, after all; I mean, some people even have a family!).</div>
<p> Calculating our model with these parameters leads to the almost incredible amount of <b>188,235</b> work <i>years</i> saved (if you assume a year of 365/7 = 52.14 weeks; of course, our hard-working R user does not have any time for vacation or any other time off). If you assume a working life is between the age of 18 and 70 this means an amount of time has been saved by sharing packages on CRAN that is is equivalent to <b>3,620</b> working <i>lives</i>. A truly incredible number. For all those who want to do the math themselves, here is the R code I used: <span>library(packagefinder)</span> <span> </span> <span># Attention: The next statement takes quite some time to run </span> <span># (> 1 hour on my machine)</span> <span>buildIndex(“searchindex.rdata”, TRUE)</span> <span>load(“searchindex.rdata”)</span> <span> </span> <span>package.count &lt;-sum(searchindex$index$DOWNL_TOTAL)</span> <span>package.count.corrected &lt;-package.count*0.7</span> <span>package.hours &lt;-package.count.corrected*1</span> <span>package.workweeks &lt;-package.hours/80</span> <span>package.workyears &lt;-package.workweeks/(365/7)</span> <span>package.worklifes &lt;-package.workyears/(70-18)</span></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://topics-in-r.blogspot.com/2018/07/a-thought-experiment-how-cran-saved.html"> Topics in R</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/-Sr0CIvDYZE" height="1"></a></div>