dlstats: Download stats of R packages

Introduction

This R package queries download stats of R packages.

Download stats of CRAN packages

library("ggplot2")
library("dlstats")

x <- cran_stats(c("emojifont", "ggimage", "hexSticker", "rvcheck"))
##   |                                                                              |                                                                      |   0%dlstats: fetching data for 2021-01
##   |                                                                              |=                                                                     |   2%
## dlstats: fetching data for 2021-02
##   |                                                                              |==                                                                    |   3%
## dlstats: fetching data for 2021-03
##   |                                                                              |===                                                                   |   5%
## dlstats: fetching data for 2021-04
##   |                                                                              |====                                                                  |   6%
## dlstats: fetching data for 2021-05
##   |                                                                              |=====                                                                 |   8%
## dlstats: fetching data for 2021-06
##   |                                                                              |======                                                                |   9%
## dlstats: fetching data for 2021-07
##   |                                                                              |========                                                              |  11%
## dlstats: fetching data for 2021-08
##   |                                                                              |=========                                                             |  12%
## dlstats: fetching data for 2021-09
##   |                                                                              |==========                                                            |  14%
## dlstats: fetching data for 2021-10
##   |                                                                              |===========                                                           |  15%
## dlstats: fetching data for 2021-11
##   |                                                                              |============                                                          |  17%
## dlstats: fetching data for 2021-12
##   |                                                                              |=============                                                         |  18%
## dlstats: fetching data for 2022-01
##   |                                                                              |==============                                                        |  20%
## dlstats: fetching data for 2022-02
##   |                                                                              |===============                                                       |  22%
## dlstats: fetching data for 2022-03
##   |                                                                              |================                                                      |  23%
## dlstats: fetching data for 2022-04
##   |                                                                              |=================                                                     |  25%
## dlstats: fetching data for 2022-05
##   |                                                                              |==================                                                    |  26%
## dlstats: fetching data for 2022-06
##   |                                                                              |===================                                                   |  28%
## dlstats: fetching data for 2022-07
##   |                                                                              |====================                                                  |  29%
## dlstats: fetching data for 2022-08
##   |                                                                              |======================                                                |  31%
## dlstats: fetching data for 2022-09
##   |                                                                              |=======================                                               |  32%
## dlstats: fetching data for 2022-10
##   |                                                                              |========================                                              |  34%
## dlstats: fetching data for 2022-11
##   |                                                                              |=========================                                             |  35%
## dlstats: fetching data for 2022-12
##   |                                                                              |==========================                                            |  37%
## dlstats: fetching data for 2023-01
##   |                                                                              |===========================                                           |  38%
## dlstats: fetching data for 2023-02
##   |                                                                              |============================                                          |  40%
## dlstats: fetching data for 2023-03
##   |                                                                              |=============================                                         |  42%
## dlstats: fetching data for 2023-04
##   |                                                                              |==============================                                        |  43%
## dlstats: fetching data for 2023-05
##   |                                                                              |===============================                                       |  45%
## dlstats: fetching data for 2023-06
##   |                                                                              |================================                                      |  46%
## dlstats: fetching data for 2023-07
##   |                                                                              |=================================                                     |  48%
## dlstats: fetching data for 2023-08
##   |                                                                              |==================================                                    |  49%
## dlstats: fetching data for 2023-09
##   |                                                                              |====================================                                  |  51%
## dlstats: fetching data for 2023-10
##   |                                                                              |=====================================                                 |  52%
## dlstats: fetching data for 2023-11
##   |                                                                              |======================================                                |  54%
## dlstats: fetching data for 2023-12
##   |                                                                              |=======================================                               |  55%
## dlstats: fetching data for 2024-01
##   |                                                                              |========================================                              |  57%
## dlstats: fetching data for 2024-02
##   |                                                                              |=========================================                             |  58%
## dlstats: fetching data for 2024-03
##   |                                                                              |==========================================                            |  60%
## dlstats: fetching data for 2024-04
##   |                                                                              |===========================================                           |  62%
## dlstats: fetching data for 2024-05
##   |                                                                              |============================================                          |  63%
## dlstats: fetching data for 2024-06
##   |                                                                              |=============================================                         |  65%
## dlstats: fetching data for 2024-07
##   |                                                                              |==============================================                        |  66%
## dlstats: fetching data for 2024-08
##   |                                                                              |===============================================                       |  68%
## dlstats: fetching data for 2024-09
##   |                                                                              |================================================                      |  69%
## dlstats: fetching data for 2024-10
##   |                                                                              |==================================================                    |  71%
## dlstats: fetching data for 2024-11
##   |                                                                              |===================================================                   |  72%
## dlstats: fetching data for 2024-12
##   |                                                                              |====================================================                  |  74%
## dlstats: fetching data for 2025-01
##   |                                                                              |=====================================================                 |  75%
## dlstats: fetching data for 2025-02
##   |                                                                              |======================================================                |  77%
## dlstats: fetching data for 2025-03
##   |                                                                              |=======================================================               |  78%
## dlstats: fetching data for 2025-04
##   |                                                                              |========================================================              |  80%
## dlstats: fetching data for 2025-05
##   |                                                                              |=========================================================             |  82%
## dlstats: fetching data for 2025-06
##   |                                                                              |==========================================================            |  83%
## dlstats: fetching data for 2025-07
##   |                                                                              |===========================================================           |  85%
## dlstats: fetching data for 2025-08
##   |                                                                              |============================================================          |  86%
## dlstats: fetching data for 2025-09
##   |                                                                              |=============================================================         |  88%
## dlstats: fetching data for 2025-10
##   |                                                                              |==============================================================        |  89%
## dlstats: fetching data for 2025-11
##   |                                                                              |================================================================      |  91%
## dlstats: fetching data for 2025-12
##   |                                                                              |=================================================================     |  92%
## dlstats: fetching data for 2026-01
##   |                                                                              |==================================================================    |  94%
## dlstats: fetching data for 2026-02
##   |                                                                              |===================================================================   |  95%
## dlstats: fetching data for 2026-03
##   |                                                                              |====================================================================  |  97%
## dlstats: fetching data for 2026-04
##   |                                                                              |===================================================================== |  98%
## dlstats: fetching data for 2026-05
##   |                                                                              |======================================================================| 100%
if (!is.null(x)) {
   print(head(x))
   ggplot(x, aes(end, downloads, group=package, color=package)) +
       geom_line() + 
       geom_point() +
       scale_y_log10()
}
##         start        end downloads   package
## 1  2021-01-01 2021-01-31      2250 emojifont
## 5  2021-02-01 2021-02-28      1738 emojifont
## 9  2021-03-01 2021-03-31      2058 emojifont
## 13 2021-04-01 2021-04-30      2018 emojifont
## 17 2021-05-01 2021-05-31      1936 emojifont
## 21 2021-06-01 2021-06-30      1749 emojifont

Download stats of Bioconductor packages

pkgs <- c("ChIPseeker", "clusterProfiler", "DOSE", "ggtree", "GOSemSim", "ReactomePA")
y <- bioc_stats(pkgs)
##   |                                                                              |                                                                      |   0%dlstats: fetching data for ChIPseeker (1/6)
##   |                                                                              |============                                                          |  17%
## dlstats: fetching data for clusterProfiler (2/6)
##   |                                                                              |=======================                                               |  33%
## dlstats: fetching data for DOSE (3/6)
##   |                                                                              |===================================                                   |  50%
## dlstats: fetching data for ggtree (4/6)
##   |                                                                              |===============================================                       |  67%
## dlstats: fetching data for GOSemSim (5/6)
##   |                                                                              |==========================================================            |  83%
## dlstats: fetching data for ReactomePA (6/6)
##   |                                                                              |======================================================================| 100%
if (!is.null(y)) {
   head(y)
   ggplot(y, aes(end, Nb_of_downloads, group=package, color=package)) +
       geom_line() + geom_point(aes(shape=package))

   library("tidyr")
   yy <- gather(y, type, Nb, Nb_of_distinct_IPs:Nb_of_downloads)

   ggplot(yy, aes(end, Nb, shape=package, color=package)) +geom_point() + geom_line() +
       ylab(NULL) + xlab(NULL) + facet_grid(type~., scales="free_y") +
       ggtitle("Number of downloads per Month") +
       scale_x_date(date_breaks="1 year", date_labels = "%Y")
}

Shiny apps

We also provide shiny app for visualizing download stats of R packages.

User can use cranApp() or biocApp() for CRAN packages and Bioconductor packages respectively.

biocApp()