Introduction

This R package queries download stats of R packages.

Download stats of CRAN packages

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

x <- cran_stats(c("dlstats", "emojifont", "rvcheck"))
head(x)
##         start        end downloads   package
## 5  2016-02-01 2016-02-29        42 emojifont
## 8  2016-03-01 2016-03-31       323 emojifont
## 11 2016-04-01 2016-04-30       257 emojifont
## 14 2016-05-01 2016-05-31       234 emojifont
## 17 2016-06-01 2016-06-23       113 emojifont
## 18 2016-06-01 2016-06-23        25   rvcheck
ggplot(x, aes(end, downloads, group=package, color=package)) +
    geom_line() + geom_label(aes(label=downloads))

Download stats of Bioconductor packages

pkgs <- c("ChIPseeker", "clusterProfiler", "DOSE", "ggtree", "GOSemSim", "ReactomePA")
y <- bioc_stats(pkgs)
head(y)
##        start        end Nb_of_distinct_IPs Nb_of_downloads    package
## 1 2016-01-01 2016-01-31                412             686 ChIPseeker
## 2 2016-02-01 2016-02-29                404             701 ChIPseeker
## 3 2016-03-01 2016-03-31                535             845 ChIPseeker
## 4 2016-04-01 2016-04-30                455             736 ChIPseeker
## 5 2016-05-01 2016-05-31                488             857 ChIPseeker
## 6 2016-06-01 2016-06-30                320             650 ChIPseeker
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")