# A thought experiment: How CRAN saved 3,620 (working) lives

**Topics in R**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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?

**1,121,724,508**package downloads as of today (afternoon [CET] of July 14th, 2018) (this number has been generated by running through all the

**12,781**R packages identified with the CRAN_package_db() function from the tools 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 fromJSON() function from the jsonlite package; to be a bit more precise: the whole operation was done with the buildIndex() function from my package packagefinder as this integrates all this functionality).

**785,207,156**downloads.

Calculating our model with these parameters leads to the almost incredible amount of **188,235** work *years* 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 **3,620** working *lives*. A truly incredible number. For all those who want to do the math themselves, here is the R code I used: library(packagefinder) # Attention: The next statement takes quite some time to run # (> 1 hour on my machine) buildIndex(“searchindex.rdata”, TRUE) load(“searchindex.rdata”) package.count <- sum(searchindex$index$DOWNL_TOTAL) package.count.corrected <- package.count*0.7 package.hours <- package.count.corrected*1 package.workweeks <- package.hours/80 package.workyears <- package.workweeks/(365/7) package.worklifes <- package.workyears/(70-18)

**leave a comment**for the author, please follow the link and comment on their blog:

**Topics in R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.