---
title: packageRankWrapperDriver
author: Barry Zeeberg [aut, cre]
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{packageRankWrapperDriver}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---


<style>
body {
text-align: justify;
font-size: 16pt;
font-family: Times;}
</style>

<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:
normal'><span style='font-size:16.0pt;font-family:"Times New Roman",serif;
color:red'>Wrapper for Convenient Tabular Rendering of Daily Quartile Ranking of Downloads of your Packages<o:p></o:p></span></b></p>

<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:
normal'><span style='font-size:16.0pt;font-family:"Times New Roman",serif'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:
normal'><span style='font-size:16.0pt;font-family:"Times New Roman",serif'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:
normal'><span style='font-size:16.0pt;font-family:"Times New Roman",serif'>Barry
Zeeberg<o:p></o:p></span></b></p>

<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:
normal'><span style='font-size:16.0pt;font-family:"Times New Roman",serif'>barryz2013@gmail.com<o:p></o:p></span></b></p><br>

<p class=MsoNormal style='text-align:justify'><span style='font-size:16.0pt;
font-family:"Times New Roman",serif'>This is a convenient program to tabulate the daily quartile ranking of downloads of your packages. It is designed to be slightly more convenient than the several similar programs. You do not need to keep typing in the names of your packages each time you want to run this.</p>

<p class=MsoNormal style='text-align:justify'><span style='font-size:16.0pt;
font-family:"Times New Roman",serif'>The program is invoked by
<br><br>
 ```
 packageRankWrapperDriver(author="Zeeberg",date_start="2026-07-05",date_end="2026-07-06")
 ```
<br><br>
    
![Daily](result.png){width=100%}
<br><br>
![Summary](summary.png){width=75%}

<br><br>There is day to day statistical fluctuation of the rank ordering, most likely the combined result of random usage by random users, as well as the update schedule of processing and posting the download data. It is useful to look at several consecutive days of data to avoid over-interpreting what might be a momentary glitch. However, there is a large overhead for downloading each day of data, so it is best to limit the number of days to no more than 4 or 5. The underlying package *packageRank* seems to compute ranks on a daily basis rather than to aggregate data over several days (which would have the benefit of smoothing out the annoying daily fluctuations). I assume this strategy was chosen to avoid the large overhead for downloading multiple days of data.

This package is a complement to my previous package *myCRAN*. I was never completely satisfied with *myCRAN*, as I never knew if the raw number of downloads was really as high as they seemed, or if the data were somehow inflated and I was fooling myself. Now I can tell that some of my packages really were doing quite well. There are some superstars like *ggplot2* that totally eclipse my packages, but apparently there are not so many like that, or mine would never achieve the 70 or 80 percentiles.

<center>**CRAN Mirror Sites**</center>

There are approximately 100 CRAN mirror sites across the globe. With the exception of one particular mirror site (namely the one associated with RStudio) it is next to impossible to retrieve any data about the number of downloads of R packages.

We are left with nothing to do except to make some assumptions about the relative downloads between one site and another.

My package myCRAN retrieves data for the RStudio mirror site.

Under the assumption that all download sites are more or less equal we can multiply the myCRAN values by 100 to get the global total. But this is not in line with reality, as my own packages cumulatively total over 100,000 downloads, and I doubt if the global total is really 100,000 x 100 = 10 million.

So we are left with trying to guess the average percentage of the RStudio site that we can expect for the other sites. Perhaps they are only 10% as active? In that case my downloads would be 100,000 + 100,000 x 100 x .10 = 100,000 + 100,000 x 10 = 100,000 + 1,000,000 = 1,100,000 which still seems astronomical but not as outrageous as 10 million.

Perhaps the most conservative estimate would be to assume that the other 99 sites in total equal the single RStudio site. In that case, we can simply double the myCRAN value, and I would have around 200,000 downloads globally.

As a final observation, although I use RStudio for package development, I never use its download site, for some reason I always use Tennessee. And for an ordinary user who is not a developer, there would be little reason to use the RStudio site, they may not even have the RStudio package in the first place. So we might not expect the RStudio site to be more active than the other sites.

It is a mystery to me as to why some packages are downloaded more than others. Of course, there are some core packages that are mentioned whenever you look something up on the internet. But if we exclude those superstars, how does this happen? I thought that perhaps there was a high profile person who reviews packages and steers tons of users towards a particular package. But I was unable to find reviews like that.

And why would a casual curious person download a package and use up their disk space, when they can just browse the package on line? It seems to me that a download indicates a certain degree of seriousness. I only download a package that I expect to immediately use within the package I am currently developing.

I have this mental image of a world full of novelty seekers, who feel compelled to get their hands on each new thing that comes out. Reminds me of compulsively collecting stamps decades ago, compelled to get each new issue.


```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```


