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"))

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  2019-01-01 2019-01-31       931 emojifont
## 5  2019-02-01 2019-02-28       757 emojifont
## 9  2019-03-01 2019-03-31      1056 emojifont
## 13 2019-04-01 2019-04-30      1074 emojifont
## 17 2019-05-01 2019-05-31      1353 emojifont
## 21 2019-06-01 2019-06-30       842 emojifont

Download stats of Bioconductor packages

pkgs <- c("ChIPseeker", "clusterProfiler", "DOSE", "ggtree", "GOSemSim", "ReactomePA")
y <- bioc_stats(pkgs)

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()